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.2.0.tar.gz
(13.8 kB
view details)
Built Distribution
File details
Details for the file object_registry-0.2.0.tar.gz
.
File metadata
- Download URL: object_registry-0.2.0.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef6858e8e44096709bffa89f64384a7987b9c5f7be60c3012516da10eabf0127 |
|
MD5 | 5bdf7feeef478e7d2e5d8ed9da721fa6 |
|
BLAKE2b-256 | 2f910926bdadfd99ca896cc84122b096c647bd67d582aa69a411933fc6d941f5 |
File details
Details for the file object_registry-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: object_registry-0.2.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 | 23591d3844752818fe26ff5d9ee97f09990baccfd3d036699ca0cad8b973a175 |
|
MD5 | cd11e21e8e0f869a12b1c01ae9633e0a |
|
BLAKE2b-256 | e0b5f63326fdb9540b13bad426a92cbb087af72989dd95867aec683ba93d1d3a |