Skip to main content

Store and retrieve data in a consistent way in a key-value store using Django Rest Framework serializers

Project description

drf-keyvalue

PyPI version coverage

Store and retrieve data in a consistent way in a key-value store using Django Rest Framework serializers

About

Supported backends

  • Redis

Installation

pip install drf-keyvalue

Setup

**Add to settings.py **

INSTALLED_APPS = [
    'drf_keyvalue',
]

Usage

For detailed usage, see the tests

from drf_keyvalue.keyvalue import get_client
from .models import Todo, TodoSerializer
import redis
redis.StrictRedis(host='localhost', port=6379, db=0)
client = get_client('keyvalue.backends.RedisBackend', connection)
todo = Todo.objects.first()
client.set(TodoSerializer, todo)
client.get(todo)
client.delete(todo)

Backend specifics:

RedisBackend

import redis
connection = redis.StrictRedis(host='localhost', port=6379, db=0)
redis_client = get_client('drf_keyvalue.backends.RedisBackend', connection=connection)

Development

Updating pypi repo:

bumpversion patch # major, minor or patch
#push to gitlab:
git push origin master

Project details


Download files

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

Source Distribution

drf-keyvalue-0.0.4.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file drf-keyvalue-0.0.4.tar.gz.

File metadata

  • Download URL: drf-keyvalue-0.0.4.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for drf-keyvalue-0.0.4.tar.gz
Algorithm Hash digest
SHA256 810805ac20797861189481649e0e34a4ef5325167e4adcda7f68d8fd92594002
MD5 cbd93a6e28a56fe77e2512322e1b1ae4
BLAKE2b-256 32328d35b9dcfe901217b9c13555166098c4455e8a95650df8a8bb74387ef02f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page