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
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
mnemoreg-0.1.1.tar.gz
(9.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mnemoreg-0.1.1.tar.gz.
File metadata
- Download URL: mnemoreg-0.1.1.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce3509e3bb4310be4cbbd23a54e06b3790465efd2c854ebe32ae98ca67303848
|
|
| MD5 |
367bf25e4f880269b6ae5e853281f78d
|
|
| BLAKE2b-256 |
d320c6f209c344849dab4f19012f2e3461d72fe857b3dfd9812e038568df9804
|
File details
Details for the file mnemoreg-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mnemoreg-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a60fdd58e5e04365b9ed8d8b7d214537562ecc4b843d1d55990da6a91e47b7f0
|
|
| MD5 |
9329f02dd86f1c542a860cbfb53ef3cb
|
|
| BLAKE2b-256 |
bb1b7fc444bbc328216b4daa85ad637edf389fbbc92461c9f3c76bfa4c7f2a07
|