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
76
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Beyond the pip
Making sense of the dependency jungle
Daniela
February 23, 2019
More Decks by Daniela
See All by Daniela
System for Continuous Health Monitoring
danielacraciun
0
60
ELK Stack
danielacraciun
0
110
DNS Tunneling
danielacraciun
0
110
Django ORM vs SqlAlchemy (an comparison)
danielacraciun
1
1.4k
Other Decks in Technology
See All in Technology
Guerilla InnerSource in enterprises, during the AI hype
onenashev
PRO
0
130
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
54k
markdown-poster Introduction
kazamori
0
440
AWSとAzureのマルチクラウド活用における強い味方___AWS_Kiroを使った二刀流スキル作成.pdf
duelist2020jp
1
160
現場の暗黙知を継承するAIエージェント — 対話から生まれる長期記憶と Skills
atsukish
0
190
いかに伝えるか 〜新卒エンジニアの教育のための、ライトノベル活用の一例
ikedon
1
130
Bet AI Day 2026丨Agentは、「金融」という巨大産業の何を変えられるのか
layerx
PRO
0
170
Cloudflare製品を活用した AIガバナンス実践入門 / AI governance with Cloudflare Service
delta_tech
1
160
AI駆動開発をチームに根付かせる - 「1行も書かない」チームがHarnessを育てた1年 -
kenichirokimura
6
3.5k
最新技術に積極チャレンジ!EKS共通基盤のこれまでとこれから
daitak
0
280
DMMブックスのNext.js化を加速させるAI活用 / Migrating DMM Books to Next.js with AI
kentarom
1
260
[RSJ26] Building a VLA Model Based on Self-Distilled Classification
keio_smilab
PRO
0
100
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
510
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
640
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
390
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
The Spectacular Lies of Maps
axbom
PRO
1
950
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
500
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!