Rack, another shelve-like
Rack contains PersistentSet and PersistentDict classes that can be used to store data using set/dict semantics, while having contents persisted to mass storage.
This library can be used when you want to use sets or mappings that may be too big to fit in RAM, or you want them to be persisted to disk, either online (as they’re used) or once (to load/save data).
It uses LMDB or SQLite3 as underlying engine:
LMDB is a tiny in-process “NoSQL” database which is very fast.
SQLite3 is a small in-process SQL database which stores data in single files, with a well-defined on-disk layout, and is rather space-efficient.
Contents are serialized from / deserialized to Python native objects on access, so the structures are obviously slower than in-memory counterparts.
Usage
Use rack.set*.PersistentSet as you would use a set, and rack.dict*.PersistentDict as you would use a dict, except that:
On construction:
They need to take a name argument indicating the (prefix to the) location of the underlying LMDB database.
For LMDB, they can take a hash argument if you want to specify a non-default hasher (default is SHA256).
They can take a serdes argument which you can use to specify a non-default serializer/deserializer (default is Python’s marshal).
On use:
They must be used with a context manager, which is required in order to properly manage the lifetime of the database open/close, as __init__ / __del__ would not be sufficient due to the garbage collected nature of Python.
Operations that create a new container (eg. union, copy), take an optional name parameter, which allows to specify the location of the new database.
If you know you store elements of limited size (less than LMDB max key size), you can use rack.set_small.PersistentSet, which is ~2x faster than the non-small one due to one less indirection. If keys are too big, lmdb.BadValsizeError exceptions will occur.
Metadata
Release files for rack 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rack-0.1.3.tar.gz | 9.9 kB | Without provenance | Details for rack-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rack-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for rack-0.1.3-py3-none-any.whl |
Total release size: 20.0 kB
Release files / rack-0.1.3.tar.gz
| Download URL | rack-0.1.3.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
267495c749582e8af08208a563c75f2fd750741935ff7c9d578675b1471fc7fe
|
|
BLAKE2b-256 checksum How to use checksums |
897c25a7fd9074978a4d2fa71d1391385787d00c07f12085272f9aefbd122cc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.9
|
Release files / rack-0.1.3-py3-none-any.whl
| Download URL | rack-0.1.3-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f6f31bea316aea408dddb3a21f6ef71621a42f8477badea845af3b97eb16024
|
|
BLAKE2b-256 checksum How to use checksums |
e59c9277d025ddfaabde36f4356129a22b6195e5a898ccdb450730db618f2063
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.9
|
Security for rack 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.