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

Uploaded Source

File details

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

File metadata

  • Download URL: drf-keyvalue-0.0.3.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.25.0 CPython/3.7.0

File hashes

Hashes for drf-keyvalue-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ec65f4dc7379c00183f6a4b2a9f0e27253105e1c220f6cada23e9ae64675bfea
MD5 a878616bd196157e6f351464d50cb39f
BLAKE2b-256 69b7439fa6c10f6302baa43745ce65bc21d017749ae154383d30bb95af0641f1

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