Skip to main content

Extremely simple key-value storage wrapper

Project description

Motivation

I usually use Redis for small projects with a dynamic storage component. Most of the times I just need a very simple key-value storage and Redis does a terrific job with that. However not all the applications need a high performance storage but just being very easy to start using them.

The idea of this wrapper is to start using JSON based storage at the beginning and in the future, if necessary, move the storate of an application to Redis or any other supported driver without changing a single line of code.

Basic usage

JSON store:

import keywrapper

store = keywrapper.new_store(‘json’)

store.set_value(‘foo’, ‘bar’, ‘42’)

store.get_value(‘foo’, ‘bar’)

Redis store:

import keywrapper

store = keywrapper.new_store(‘redis’)

store.set_value(‘foo’, ‘bar’, ‘42’)

store.get_value(‘foo’, ‘bar’)

Migrate from JSON store to Redis store:

import keywrapper

json_store = keywrapper.new_store(‘json’)

redis_store = keywrapper.new_store(‘redis’)

redis_store.restore(json_store.dump())

Current status

These are the current implemented features:

  • JSON and Redis drivers

  • Hash style data type (key, attribute, value)

  • set_value and get_value functions

  • dump function implemented only in JSON driver

  • restore function implemented in both JSON and Redis drivers

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

keywrapper-0.1.0.tar.gz (1.5 kB view details)

Uploaded Source

File details

Details for the file keywrapper-0.1.0.tar.gz.

File metadata

  • Download URL: keywrapper-0.1.0.tar.gz
  • Upload date:
  • Size: 1.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for keywrapper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e9c8d63b04ee6f0438c660c2dd13b1792c7198f2f596d9511a5fef9131f7a137
MD5 a37546a1f9ad9871d393d3de34d11574
BLAKE2b-256 28b7c037a34da0bbeb21abb8a4a949dab67b37f4c76f6b3e5e47fb29f1268b37

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