Skip to main content

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.

Installation

pip install subregistry

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

subregistry-0.1.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

subregistry-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file subregistry-0.1.1.tar.gz.

File metadata

  • Download URL: subregistry-0.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.16

File hashes

Hashes for subregistry-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d4fe0e6eb3a4295ee9b5eaab7050d0c90cb1c22aa487d02ce228dbad6851ec54
MD5 4efd77d591fa5ddf489ba82dac82ede3
BLAKE2b-256 ef373ba983aca7f4d5fdb89f6f6ad1292744804b7c4df74419d785780d040f64

See more details on using hashes here.

File details

Details for the file subregistry-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for subregistry-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0f5b7012219f802d1521adf1b5dbacf3940f0e96505bed1897811573f32abc2
MD5 436ec7abaf6132062d0ce1ead2ba280e
BLAKE2b-256 9e24e7a2b2d36fbea067968a81bd061698c085ff908379bfee97d10a8a94a18d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page