PyDocs

Importing Modules

importlib.resources

Read resources contained within a package.

This codebase is shared between importlib.resources in the stdlib
and importlib_resources in PyPI. See
https://github.com/python/importlib_metadata/wiki/Development-Methodology
for more detail.
Symbols in importlib.resources

a

Anchor
Represents an anchor for resources, either a module object or a module name as a string.
as_file
Given a Traversable object, return that object as a path on the local file system in a context manager.

c

contents
Return an iterable over the named resources within the package.

f

files
Get a Traversable resource for an anchor.

i

is_resource
Return ``True`` if there is a resource named *name* in the package,

o

open_binary
Open for binary reading the *resource* within *package*.
open_text
Open for text reading the *resource* within *package*.

p

path
Return the path to the *resource* as an actual file system path.

r

read_binary
Read and return contents of *resource* within *package* as bytes.
read_text
Read and return contents of *resource* within *package* as str.