store_var
Wrapper, that stores a list into a file on every list update. A band-aid solution for a small project, when database is an overkill.
from store_var import stored
# Stores to file on first initializaiton
users = stored('users.pickle', [
{'name': 'Gregory', 'age': 45},
{'name': 'James', 'age': 37},
])
# Behaves as a list
print(f"There are {len(users)} users") # → There are 2 users
# On each change, storage file is updated
users.append({'name': 'Lisa', 'age': 38})
# ··· After restarting a REPL ···
users = stored('users.pickle')
print(users)
# → stored({'name': 'Gregory', 'age': 45}, {'name': 'James', 'age': 37}, {'name': 'Lisa', 'age': 38})
# Notice, that there are 3 users now
Installation
pip install store_var
Limitations
Wrappers for reverse, sort, copy and deepcopy are not implemented yet.
Everything else works and is unit-tested.
Stores data using pickle.
Supports only a lists of picklable objects. Won't store a dict, or a list of lambdas.
Examples
See tests.
Metadata
Release files for store-var 1
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 | |
|---|---|---|---|---|
| store_var-1.tar.gz | 4.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| store_var-1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.2 kB
Release files / store_var-1.tar.gz
| Download URL | store_var-1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cfa6dd552ce2ea610f89cfce0ccfdeb5421c9203b5c9ed92e73f3f808033d5d
|
|
BLAKE2b-256 checksum How to use checksums |
8af854d99b568a6a903fe36c1f859a4b21c848222f38d799651ed11fef2714d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Release files / store_var-1-py3-none-any.whl
| Download URL | store_var-1-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2f5dff3c19ced16b11fe3cc80f20fe02a388615334d7ef2d24c212dcaa026ba
|
|
BLAKE2b-256 checksum How to use checksums |
eb8aa6c98f3af9c2bc638c9aec6940529bb3c0118ee402a917ce634622475596
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.10
|
Security for store-var 1
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.