Skip to main content

Gufo Loader

Typed runtime object resolution for Python.

PyPi version Downloads Python Versions Discord License Build codecov Sponsors Ruff


Documentation: https://docs.gufolabs.com/gufo_loader/

Source Code: https://github.com/gufolabs/gufo_loader/


Gufo Loader provides tools to resolve Python objects at runtime from string identifiers with full typing and IDE support.

It is designed for applications where object selection is driven by configuration or runtime state.

Two resolution models

Gufo Loader supports two complementary ways to resolve Python objects.

          String identifier
                 │
      ┌──────────┴──────────┐
      │                     │
 Full import path      Logical name
      │                     │
ImportPathResolver        Loader
      └──────────┬──────────┘
                 │
          Python object

Direct resolution (full import path)

A Python object is identified by its fully qualified import path.

"myproject.handlers.process"

Use ImportPathResolver:

resolver = ImportPathResolver[Callable[..., Any]]()
handler = resolver("myproject.handlers.process")

Use this when the exact location of the object is known.

Named resolution (logical name)

A Python object is referenced by a short logical name:

"json"

The system resolves it to a concrete implementation. Use Loader:

loader = Loader[type[BasePlugin]](base="myproject.plugins")
plugin = loader["json"]

Use this when behavior is selected by configuration or convention.

ImportPathResolver

Resolves full Python import paths into objects.

resolver("package.module.symbol")

Properties:

  • works with any Python object
  • caching of successful resolutions
  • optional negative caching
  • strict typing support
  • safe, deterministic import behavior

Loader

Loader discovers and resolves typed objects from one or more Python packages.

It supports three plugin models:

Class-based plugins

Loader[type[BasePlugin]]

Singleton instances

Loader[BasePlugin]

Protocol-based plugins

Loader[MyProtocol]

Properties:

  • subclasses, instances and protocols
  • no registration
  • multiple package namespaces
  • lazy discovery
  • type validation
  • predictable resolution behavior

Features

  • Zero dependencies — no external runtime dependencies
  • Fully typed API — generics, protocols, subclass-safe resolution
  • IDE-friendly — autocompletion and static type inference support
  • Lazy loading — modules imported only when needed
  • Caching — resolved objects are cached for performance
  • Negative caching — failed resolutions are cached to avoid repeated lookups
  • Secure by design — only explicit Python imports are performed
  • Deterministic behavior — predictable resolution for identical inputs
  • Multi-package support — load plugins from multiple namespaces
  • Custom key mappings — map public plugin keys to module names via encode_key() / decode_key()

On Gufo Stack

This product is a part of Gufo Stack - the collaborative effort led by Gufo Labs. Our goal is to create a robust and flexible set of tools to create network management software and automate routine administration tasks.

To do this, we extract the key technologies that have proven themselves in the NOC and bring them as separate packages. Then we work on API, performance tuning, documentation, and testing. The NOC uses the final result as the external dependencies.

Gufo Stack makes the NOC better, and this is our primary task. But other products can benefit from Gufo Stack too. So we believe that our effort will make the other network management products better.

Metadata

Release files for gufo-loader 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gufo-loader 3.1.0
File Size Uploaded Provenance Actions
gufo_loader-3.1.0.tar.gz 20.4 kB With provenance Details for gufo_loader-3.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gufo-loader 3.1.0
File Interpreter ABI Platform Actions
gufo_loader-3.1.0-py3-none-any.whl Python 3 none any Details for gufo_loader-3.1.0-py3-none-any.whl

Total release size: 32.0 kB

Release files / gufo_loader-3.1.0.tar.gz

Download URL gufo_loader-3.1.0.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d475c5c6a549a774f22b7e61d4094dba1d80c3e70ef266e49be698cebff745e6
BLAKE2b-256 checksum
How to use checksums
3f047d4d4d4410a39a5e0e27ea627ca96bf47e4465fc53f030525cf833522057
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / gufo_loader-3.1.0-py3-none-any.whl

Download URL gufo_loader-3.1.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
addb57db62ee358f957d4b75eb31f23a766de125ba3d0235a92f6610d66d0afa
BLAKE2b-256 checksum
How to use checksums
dd61abd6321687b38c2addfd6bccfb975e3e4f2ea83fc8b48f6af62b30429be3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for gufo-loader 3.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gufo_loader-3.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page