Skip to main content

Simple and convenient Key-value Store Library

Project description

pykvs_lite

Key-Value Store for Python

Features

  • Simple and convenient Key-value Store Library
  • Easy to install (Use SQLite for the back end)

Installation

$ python3 -m pip install pykvs_lite

Repository

Simple sample

The pykvs has set and get method. However, you need to connect to the file before you use it.

import pykvs_lite as kvs

# connect to KVS
kvs.connect('test.db')

# set
kvs.set('hoge', 1234)

# get
print(kvs.get('hoge'))
# get default value
print(kvs.get('hoge_1st', 'not exists'))

# close
kvs.close()

Enum keys

import pykvs_lite as kvs
import json

# connect and set
kvs.connect('test.db')
kvs.set('hoge', 1234)
kvs.set('fuga', 'いろは')
kvs.set('foo', [1,2,3])

# enums
for key in kvs.keys():
    print(key, '=', json.dumps(kvs.get(key), ensure_ascii=False))

# dump to json
print(kvs.dump_json())
kvs.close()

Use Multi tables

It can use multi tables.

import pykvs_lite as kvs

# set table_name
kvs.connect('test.db', table_name='no1')
kvs.set('hoge', 123)

# change table_name
kvs.connect('test.db', table_name='no2')
print(kvs.get('hoge', 'not_exists')) # show 'not_exists'

only memory

import pykvs_lite as kvs

# set table_name
kvs.connect()
kvs.set('hoge', 123)
print(kvs.get('hoge'))

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

pykvs_lite-0.1.8.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

pykvs_lite-0.1.8-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pykvs_lite-0.1.8.tar.gz.

File metadata

  • Download URL: pykvs_lite-0.1.8.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for pykvs_lite-0.1.8.tar.gz
Algorithm Hash digest
SHA256 1a0d73b16147c04cade99344348d9dae7b186e768c0b413d90032a1b50453208
MD5 a36df98c0f760a746b888d03f4a848c8
BLAKE2b-256 eeb2153aa6dbf029f3dc96bf829876412e1e4e8afe1e5d1f5b23501409770dbd

See more details on using hashes here.

File details

Details for the file pykvs_lite-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: pykvs_lite-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for pykvs_lite-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 1a8da45a6ffdb69bdf5e12f247627551d548696fbd67d8727a748d8ce19061f8
MD5 a66e8371b081e80e87172809f89fd2cb
BLAKE2b-256 f66de99b3595b768109ead0dd1c6c17ff1977d41b8db53a2e508c1e67b892fe1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page