Utility Python library to easily create registries of sub-classes and import them conveniently.
Project description
subregistry
Utility Python library to easily create registries of sub-classes and import them conveniently.
Usage
To add a registry to a class, simply import and use the decorator:
from subregistry import add_registry
@add_registry
class BaseClass:
pass
Any Imported subclass of BaseClass will then automatically be registered.
Registered subclasses can later be retrieved by name as follows:
BaseClass.registry.get_by_name("SubClass")
See the examples folder for more in-depth usages.
Author
- Thomas Havy
Project details
Release history Release notifications | RSS feed
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 subregistry-0.1.0.tar.gz.
File metadata
- Download URL: subregistry-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
107f18bc4c937907d5cd9b7b514b39461c74e2871e963d158246f695ad46444a
|
|
| MD5 |
298a0b52b077c455b9f6bd45d31163ca
|
|
| BLAKE2b-256 |
c8890a20f988c63a5db3100d1db138f14c587cae7a9ec260ca7ddc100f1e64a5
|
File details
Details for the file subregistry-0.1.0-py3-none-any.whl.
File metadata
- Download URL: subregistry-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8ccbf223ea3f66bf1e12b3361b937fd178a7eb3badb0dbff9aaded0037a432a
|
|
| MD5 |
d9056f9baf6bed8fe55dfd9138771278
|
|
| BLAKE2b-256 |
8be758c585c2fca9964496d6c0b592cbcdc54eb1a53536ac6164404556b3824c
|