Welcome to importlib_resources documentation!

importlib_resources is a library which provides for access to resources in Python packages. It provides functionality similar to pkg_resources Basic Resource Access API, but without all of the overhead and performance problems of pkg_resources.

In our terminology, a resource is a file tree that is located within an importable Python package. Resources can live on the file system or in a zip file, with support for other loader classes that implement the appropriate API for reading resources.

importlib_resources is a backport of Python 3.9’s standard library importlib.resources module for Python 2.7, and 3.5 through 3.8. Users of Python 3.9 and beyond are encouraged to use the standard library module. Developers looking for detailed API descriptions should refer to the Python 3.9 standard library documentation.

The documentation here includes a general usage guide and a migration guide for projects that want to adopt importlib_resources instead of pkg_resources.

Indices and tables