PyKeyVal
Heavily inspired by
keyv
PyKeyVal is a key-value store that you can pack in a bag and take with you.
Installation
To install PyKeyVal, simply:
pip install pykeyval
or from source:
python setup.py install
Getting Started
>>> import pykeyval
>>> kv = pykeyval.PyKeyVal(url='sqlite:///opt/myapp/db.sqlite')
>>> kv.set('key', 'val')
True
>>> kv.get('key')
'val'
API
get(key)
Returns the value set for key key.
set(key, val)
Sets the key key to a value val. Returns True.
delete(key)
Deletes the key key. Returns True if the key existed.
clear()
Deletes all keys in the current name and namespace. Returns True.
Storage Backends
PyKeyVal supports the following backends:
| Database | Interface | Required Arguments | Options |
|---|---|---|---|
| Memory | DictKeyVal | ||
| File | FileKeyVal | name | path |
| Redis | RedisKeyVal | url, name | namespace |
| Snowflake | SnowKeyVal | url, name | namespace |
| SQLite | SQLiteKeyVal | url, name | namespace |
| PostgreSQL | Coming soon | ||
| MySQL | Coming soon |
Namespaces
PyKeyVal allows you to setup namespaces for database backends to prevent key collisions.
Serializers
PyKeyVal uses python's builtin json library to perform data serialization across multiple backends for data consistency.
You can hook up your own serializer by passing in a serializer class that implements serialize and deserialize:
class PickleSerializer:
def serialize(data):
pickle.dumps(data)
def deserialize(data):
pickle.loads(data)
kv = PyKeyVal(serializer=PickleSerializer)
Metadata
Release files for pykeyval 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pykeyval-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for pykeyval-0.0.2-py3-none-any.whl |
Release files / pykeyval-0.0.2-py3-none-any.whl
| Download URL | pykeyval-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f613588aee4c74787de591eb942d8c11765d8c7c25e3c2aa8230d61d3c936bc5
|
|
BLAKE2b-256 checksum How to use checksums |
2cc4d79d3877892810f923e645dfa179fc1c749cdd8ed5c724d16dab70c45990
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.0 CPython/3.7.5
|
Security for pykeyval 0.0.2
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.