Escondite
Escondite is a simple caching library for Python that allows you to store and retrieve data with string keys. Escondite is used by the Bolinette project to cache classes at script load time.
Installation
$ pip install escondite # or use your preferred package manager
Usage
Escondite provides a Cache class that can be used as a singleton or instantiated as needed.
You can also use the default user cache instance __user_cache__ to store everything in a single global cache.
from collections.abc import Callable
from escondite import Cache, __user_cache__
def cache_class[**P, T](cls: Callable[P, T], *, cache: Cache | None = None) -> Callable[P, T]:
Cache.with_fallback(cache).add('stored_classes', cls)
return cls
@cache_class
class MyClass:
pass
assert 'stored_classes' in __user_cache__
assert __user_cache__.get('stored_classes') == {MyClass}
In this example, the cache_class decorator adds the decorated class to the cache under the key 'stored_classes'.
If the cache funtion is called without a specific cache, it uses the global __user_cache__ instance with the with_fallback method.
Metadata
Release files for escondite 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| escondite-0.1.2.tar.gz | 2.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| escondite-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.9 kB
Release files / escondite-0.1.2.tar.gz
| Download URL | escondite-0.1.2.tar.gz |
|---|---|
| Size | 2.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a567e096b7c25343bb7890b41521668fdbe3fdd76509d9ce2047c1f87d05056d
|
|
BLAKE2b-256 checksum How to use checksums |
a9f3907a17de810dd3047e93fd699675422e9d00d2db266b2a409301f1a05f53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / escondite-0.1.2-py3-none-any.whl
| Download URL | escondite-0.1.2-py3-none-any.whl |
|---|---|
| Size | 2.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
db0427fd0628874c800b4164333d342a65ad52a0ea006e2387f84755f2fcf0a7
|
|
BLAKE2b-256 checksum How to use checksums |
34f1abeee0105c33d8f3ad1792baae8d8016211c1dceb317a7723f37c734c37c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|