Keep track of all instantiated objects of a class.
Project description
Object Registry
Keep track of all instantiated objects of a class.
Installation
pip install object-registry
Getting started
For any class whose objects you want to track, inherit from ObjectRegistry
upon definition.
from object_registry import ObjectRegistry
class MyClass(ObjectRegistry): ...
Instantiate objects of the derived class as usual. Each object will be automatically added to the registry.
obj = MyClass()
Use from_id
to retrieve an object by its Python object ID.
object_id = id(obj)
retrieved_obj = MyClass.from_id(object_id)
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
object_registry-0.1.0.tar.gz
(13.9 kB
view details)
Built Distribution
File details
Details for the file object_registry-0.1.0.tar.gz
.
File metadata
- Download URL: object_registry-0.1.0.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcb9a667cb623c33add3e0370333a32339a770efc70968215396c34d9b7ef88e |
|
MD5 | bd6d49e3ed57a526dfefaa52af7a0be3 |
|
BLAKE2b-256 | 009b88cd15e58c33bad6d7c419ce8a0279546e46ac404c34e53d652ff1a1574c |
File details
Details for the file object_registry-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: object_registry-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47d032a971f99b801ae145559a485d69a33b97c044696c6e09311dae90cf28ce |
|
MD5 | d02969cff0bbe00b0559e5d288df0f22 |
|
BLAKE2b-256 | 2b685da33713efa68c357f73d16de3874cc8fa187c8ca5827e37b382821aaa2e |