ocrd_utils.package_resources module

ocrd_utils.package_resources.resource_filename(package: str, resource: str) pathlib.Path[source]

Reimplementation of the function with the same name from pkg_resources

Using importlib for better performance

packagestr

The package from where to start looking for resource (often __name__)

resourcestr

The resource to look up

ocrd_utils.package_resources.resource_string(package: str, resource: str) bytes[source]

Reimplementation of the function with the same name from pkg_resources

Using importlib for better performance

packagestr

The package from where to start looking for resource (often __name__)

resourcestr

The resource to look up

ocrd_utils.package_resources.get_distribution(distribution_name)

Get the Distribution instance for the named package.

Parameters

distribution_name – The name of the distribution package as a string.

Returns

A Distribution instance (or subclass thereof).