pyvisor.resources package

Module contents

Utilities for accessing packaged resource files.

pyvisor.resources.icon_categories() Iterable[Path][source]

Return all available icon category directories.

pyvisor.resources.icons_root() Path[source]

Return the root directory for bundled icons.

pyvisor.resources.iter_resource_dirs(*relative_parts: str) Iterator[Path][source]

Yield filesystem paths for sub-directories of a packaged resource.

pyvisor.resources.portable_icon_path(icon_path: str | None) str | None[source]

Convert an absolute bundled icon path to a relative one for portability.

pyvisor.resources.resolve_icon_path(icon_path: str | None) str | None[source]

Resolve a possibly-relative icon path back to an absolute one.

pyvisor.resources.resource_path(*relative_parts: str) Path[source]

Return the filesystem path for a bundled resource.

Works both in development (using importlib.resources) and when frozen by PyInstaller (using sys._MEIPASS).