importlib-resources

6.5.2 · active · verified Sat Mar 28

A backport of Python's importlib.resources module, providing access to resources within packages. Current version: 6.5.2. Release cadence: Regular updates with recent releases in January 2025.

Warnings

Install

Imports

Quickstart

Access a text file within the package using importlib-resources

import os
from importlib_resources import files

# Access a text file within the package
resource = files('my_package').joinpath('data', 'example.txt').read_text()
print(resource)

view raw JSON →