Metadata-Version: 2.4
Name: mnemoreg
Version: 0.1.0
Summary: A tiny thread-safe registry mapping for simple plugin/registry use-cases.
Author: Björn Schrammel
License: MIT
Project-URL: Source, https://github.com/i3iorn/mnemoreg
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: isort; extra == "dev"
Dynamic: license-file

# 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

```python
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.

