Skip to main content

A tiny thread-safe registry mapping for simple plugin/registry use-cases.

Project description

mnemoreg

mnemoreg is a tiny thread-safe registry mapping useful for registering callables and other values by string keys. It's intentionally small and suitable for embedding in other projects.

Quickstart

from mnemoreg import Registry

r = Registry[str, int]()
r["one"] = 1
print(r["one"])  # 1


@r.register("plus")
def plus(x):
    return x + 1


print(r["plus"](4))  # 5

See tests/ for more usage examples.

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

mnemoreg-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

mnemoreg-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file mnemoreg-0.1.0.tar.gz.

File metadata

  • Download URL: mnemoreg-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for mnemoreg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 19969994569b494e34b5dd775e84b61f32e40f6a3153b4f189e1fa96814bb109
MD5 269ba301d1fd5a013091d046555e6349
BLAKE2b-256 c5aea634eaaee2fd78b37fe410726ddcd7d0afe087b56c751bbb4b5091dc55de

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mnemoreg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for mnemoreg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2fc77e6e7c5fde7c85901befdfc8132d287c85916846999bd8a835dd1ce658b
MD5 f482e9a921d01440216f24c2c4e38b98
BLAKE2b-256 19b212a2652ffd359c39845eed44dc572273bddda32cd18d75d497b0a8b4ae21

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