Resource Scanning APIs¶
oxidized_importer module exposes functions and Python types to
facilitate scanning for and collecting Python resources.
This function scans a filesystem path and returns discovered resources.
find_resources_in_path() for the API documentation.
To discover all filesystem based resources that Python’s
meta path finder would (with the exception of
.zip files), try the
import os import oxidized_importer import sys resources =  for path in sys.path: if os.path.isdir(path): resources.extend(oxidized_importer.find_resources_in_path(path))
OxidizedResourceCollector Python Type¶
OxidizedResourceCollector type provides functionality
for turning instances of Python resource types into a collection
OxidizedResource for loading into an
instance. It exists as a convenience, as working with individual
OxidizedResource instances can be rather cumbersome.
To create a collector that only marks resources for in-memory loading:
import oxidized_importer collector = oxidized_importer.OxidizedResourceCollector( allowed_locations=["in-memory"] )