Skip to main content

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


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)

Uploaded Source

Built Distribution

object_registry-0.1.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

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

Hashes for object_registry-0.1.0.tar.gz
Algorithm Hash digest
SHA256 dcb9a667cb623c33add3e0370333a32339a770efc70968215396c34d9b7ef88e
MD5 bd6d49e3ed57a526dfefaa52af7a0be3
BLAKE2b-256 009b88cd15e58c33bad6d7c419ce8a0279546e46ac404c34e53d652ff1a1574c

See more details on using hashes here.

File details

Details for the file object_registry-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for object_registry-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47d032a971f99b801ae145559a485d69a33b97c044696c6e09311dae90cf28ce
MD5 d02969cff0bbe00b0559e5d288df0f22
BLAKE2b-256 2b685da33713efa68c357f73d16de3874cc8fa187c8ca5827e37b382821aaa2e

See more details on using hashes here.

Supported by

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