Typed runtime object resolution for Python
Project description
Gufo Loader
Typed runtime object resolution for Python.
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
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gufo_loader-2.0.0.tar.gz.
File metadata
- Download URL: gufo_loader-2.0.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8dc9cd7b48b8ef28a8f6ed73d011101b1aa47499eba9e92d63657bcfe2598c99
|
|
| MD5 |
910256edcd54f91fdd3e3d51aa0b133f
|
|
| BLAKE2b-256 |
becd6d417fca1c895c8e5258be779f9e6fe841cf02457820ea523f29df58190e
|
Provenance
The following attestation bundles were made for gufo_loader-2.0.0.tar.gz:
Publisher:
py-tests.yml on gufolabs/gufo_loader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gufo_loader-2.0.0.tar.gz -
Subject digest:
8dc9cd7b48b8ef28a8f6ed73d011101b1aa47499eba9e92d63657bcfe2598c99 - Sigstore transparency entry: 2007742839
- Sigstore integration time:
-
Permalink:
gufolabs/gufo_loader@7f48943e2d6d33ba2c53f300e4cba5a609a7190e -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/gufolabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
py-tests.yml@7f48943e2d6d33ba2c53f300e4cba5a609a7190e -
Trigger Event:
release
-
Statement type:
File details
Details for the file gufo_loader-2.0.0-py3-none-any.whl.
File metadata
- Download URL: gufo_loader-2.0.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08de1e036b9dcdb4f42da0f6c0edc2e018f3f299c1224cf9c57de086ceeda74c
|
|
| MD5 |
3a49e54c0d7148452e7ce1cfe841d4bd
|
|
| BLAKE2b-256 |
d58909e5332e9836a97d6d38bbfc965d9f9ccc30262a3131548fbdd8581b91fc
|
Provenance
The following attestation bundles were made for gufo_loader-2.0.0-py3-none-any.whl:
Publisher:
py-tests.yml on gufolabs/gufo_loader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gufo_loader-2.0.0-py3-none-any.whl -
Subject digest:
08de1e036b9dcdb4f42da0f6c0edc2e018f3f299c1224cf9c57de086ceeda74c - Sigstore transparency entry: 2007743003
- Sigstore integration time:
-
Permalink:
gufolabs/gufo_loader@7f48943e2d6d33ba2c53f300e4cba5a609a7190e -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/gufolabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
py-tests.yml@7f48943e2d6d33ba2c53f300e4cba5a609a7190e -
Trigger Event:
release
-
Statement type: