Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Beyond the pip
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Daniela
February 23, 2019
Technology
0
66
Beyond the pip
Making sense of the dependency jungle
Daniela
February 23, 2019
Tweet
Share
More Decks by Daniela
See All by Daniela
System for Continuous Health Monitoring
danielacraciun
0
52
ELK Stack
danielacraciun
0
110
DNS Tunneling
danielacraciun
0
97
Django ORM vs SqlAlchemy (an comparison)
danielacraciun
1
1.4k
Other Decks in Technology
See All in Technology
TUNA Camp 2026 京都Stage ヒューリスティックアルゴリズム入門
terryu16
0
530
CloudFrontのHost Header転送設定でパケットの中身はどう変わるのか?
nagisa53
1
200
欠陥分析(ODC分析)における生成AIの活用プロセスと実践事例 / 20260320 Suguru Ishii & Naoki Yamakoshi & Mayu Yoshizawa
shift_evolve
PRO
0
430
AIエージェント×GitHubで実現するQAナレッジの資産化と業務活用 / QA Knowledge as Assets with AI Agents & GitHub
tknw_hitsuji
0
250
【PHPerKaigi2026】OpenTelemetry SDKを使ってPHPでAPMを自作する
fendo181
1
300
VSCode中心だった自分がターミナル沼に入門した話
sanogemaru
0
750
Sansanの認証基盤を支えるアーキテクチャとその振り返り
sansantech
PRO
1
100
SaaSに宿る21g
kanyamaguc
2
170
The essence of decision-making lies in primary data
kaminashi
0
110
Agent Skill 是什麼?對軟體產業帶來的變化
appleboy
0
240
Bref でサービスを運用している話
sgash708
0
200
Kubernetesの「隠れメモリ消費」によるNode共倒れと、Request適正化という処方箋
g0xu
0
140
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
300
Between Models and Reality
mayunak
2
240
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
0
470
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.5k
The Limits of Empathy - UXLibs8
cassininazir
1
270
How to Think Like a Performance Engineer
csswizardry
28
2.5k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Ruling the World: When Life Gets Gamed
codingconduct
0
180
Navigating Weather and Climate Data
rabernat
0
150
Transcript
Beyond Beyond the pip the pip
Disclaimer: this is not about Disclaimer: this is not about
pip (in particular). pip (in particular).
None
[Introduction slide]
None
It's the year 2019 It's the year 2019 are we
supposed to write our are we supposed to write our own code now?? own code now??
NOPE. NOPE. BUT DOUBT. EVERYTHING. BUT DOUBT. EVERYTHING.
None
The good The good
The good The good Multitude of libraries
The good The good Multitude of libraries Ease of use
The good The good Multitude of libraries Ease of use
Open source software
The bad The bad
The bad The bad Poorly written & documented
The bad The bad Poorly written & documented Not optimized
The bad The bad Poorly written & documented Not optimized
Might go missing
The ugly The ugly
The ugly The ugly Security issues
The ugly The ugly Security issues Malicious activity (typosquatting happening)
The ugly The ugly Security issues Malicious activity (typosquatting happening)
Dependency hell
Review time! Review time!
Is the library... Is the library...
Is the library... Is the library... mature? mature?
Is the library... Is the library... mature? mature? used in
commercial products? used in commercial products?
Is the library... Is the library... mature? mature? used in
commercial products? used in commercial products? backed up by other organizations? backed up by other organizations?
Is the library... Is the library...
Is the library... Is the library... used all through your
project? used all through your project?
Is the library... Is the library... used all through your
project? used all through your project? heavily relying on other libraries? heavily relying on other libraries?
Improve the library Improve the library Contribute to open source!
Contribute to open source!
Use a pattern... Use a pattern... wrap it up! (the
code, that is) wrap it up! (the code, that is) from external_dependency import something class SomeExternalDependencyClient: def __init__(self, credentials, name): self.client = something.Client(credentials, name) def get_items(self, ids): self.client.get(ids) def send_items(self, item_list): self.client.batch_insert(item_list)
The standard library is The standard library is awesome! awesome!
Good resources Good resources Module of the Week by Doug Hellmann PyTricks by Dan Bader
You have You have ... ... magic methods magic methods
class Hasher(object): def __init__(self, algorithm): self.algorithm = algorithm def __call__(self, file): hash = self.algorithm() with open(file, 'rb') as f: for chunk in iter(lambda: f.read(4096), ''): hash.update(chunk) return hash.hexdigest() md5 = Hasher(hashlib.md5) sha1 = Hasher(hashlib.sha1) md5(somefile)
Awesome Awesome decorators decorators from functools import wraps def retry(count=5,
exc_type=Exception): def decorator(func): @wraps(func) def result(*args, **kwargs): last_exc = None for _ in range(count): try: return func(*args, **kwargs) except exc_type as e: last_exc = e raise last_exc return result return decorator @retry def might_fail(): # some code here pass
class Cache: def __init__(self): self.memo = {} def store(self, fn):
def wrapper(*args): if args not in self.memo: self.memo[args] = fn(*args) return self.memo[args] return wrapper def clear(self): self.memo.clear() cache = Cache() @cache.store def somefct(): return expensive_call() cache.clear()
Powerful Powerful containers containers >>> from collections import Counter >>>
colors = ['blue', 'red', 'blue', 'yellow', 'blue', 'red'] >>> counter = Counter(colors) Counter({'blue': 3, 'red': 2, 'yellow': 1}) >>> counter.most_common()[0][0] 'blue' >>> Point = collections.namedtuple('Point', 'x y') >>> p = Point(1, y=2) Point(x=1, y=2) >>> p.x 1 >>> getattr(p, 'y') 2 >>> p._fields ('x', 'y')
and so many MORE! and so many MORE! utilities utilities
powerful powerful speci c operations speci c operations dev tools: dev tools: , , , , date & time handling date & time handling regex regex os os pydoc pydoc unittest unittest pdb pdb
I still think libraries are cool, I still think libraries
are cool, okay? okay?
This is it. Thank you!