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


Release history Release notifications

This version
History Node

0.1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
keywrapper-0.1.0.tar.gz (1.5 kB) Copy SHA256 hash SHA256 Source None Apr 18, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page