Get your resources faster, with importlib.resources
summary
importlib.resources provides concrete APIs like read_binary, read_text and context-manager path that avoid pkg_resources import-time overhead, work with zipimport, and require resources to live inside real packages. LinkedIn reports 25–50% faster CLI responsiveness after switching (with Shiv replacing PEX). Backported shim lets older Pythons adopt the efficient behavior. The library builds on Python’s import system, creates temporary files only inside a with block, and exposes loader hooks for custom sources.
AI-written summary · about
chapters (4)
related talks
30mImporting Without "import": Behind the Scenes of importlib
30mLazy imports and the art of interpreter procrastination
27mNo time to idle about: Profiling import time in Python
25mThe Bakery: How PEP810 sped up my bread operations business
26mWhat happens behind execution of an `import` statement?
53mRethinking How We're Linking: What to do when speeding...
23mHooking into the import system
32mInterfacing R and Python
