Skip to main content

PyKeyVal is a key-value store that you can pack in a bag and take with you.

Project description


Heavily inspired by keyv


PyKeyVal is a key-value store that you can pack in a bag and take with you.


To install PyKeyVal, simply:

pip install pykeyval

or from source:

python install

Getting Started

>>> import pykeyval
>>> kv = pykeyval.PyKeyVal(url='sqlite:///opt/myapp/db.sqlite')
>>> kv.set('key', 'val')
>>> kv.get('key')



Returns the value set for key key.

set(key, val)

Sets the key key to a value val. Returns True.


Deletes the key key. Returns True if the key existed.


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


PyKeyVal allows you to setup namespaces for database backends to prevent key collisions.


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):
    def deserialize(data):

kv = PyKeyVal(serializer=PickleSerializer)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release. See tutorial on generating distribution archives.

Built Distribution

pykeyval-0.0.2-py3-none-any.whl (6.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page