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.5.tar.gz (2.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: drf-keyvalue-0.0.5.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for drf-keyvalue-0.0.5.tar.gz
Algorithm Hash digest
SHA256 ce72ea5da5a0933a78177da71c2e94a8b69f1176f0ddbd90cdacc881cedd7ace
MD5 e8a9cd97582b3c0ba491b630b52f78b3
BLAKE2b-256 8a5a32bc9c2f348f6de1a444d7f3d2b3b457a1b4f4876d9d5396e62fd61d9224

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