Skip to main content

.json file based key/value storage

Project description

json_kvs is dependency free library for key/value storage, based on json file

json_kvs can receive optional 'scope' parameter, what allows to use same file in multiple scripts simultaneously

Installation

pip install json_kvs

Usage

kvsObj = KVS('path_to_json_file', scope='scope_name'(OPTIONAL))

kvsObj.set_value('key', 'value') -- write value

kvsObj.get_value('key') -- reade value

Example

from json_kvs import KVS
key = 'key1'
value = 'val1'
scope = 'test_scope1'
pathToJson = '/tmp/kvs.json'

kvsObj = KVS(pathToJson, scope=scope)

kvsObj.set_value(key, value)

print(kvsObj.get_value(key))

License

MIT

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

json_kvs-0.1.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file json_kvs-0.1.tar.gz.

File metadata

  • Download URL: json_kvs-0.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for json_kvs-0.1.tar.gz
Algorithm Hash digest
SHA256 950c9774eff4ac6726e9f0c68a654bc1770af85d44114fe88f1544954bc0b54b
MD5 b37dbc80020c3f5a18a718cd4a8129ce
BLAKE2b-256 0c7f853ec6174caacb8cf77500c727c9e7954b1102bf1684e7e8b190caa2d6ee

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