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'))
Metadata
Release files for pykvs-lite 0.1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pykvs_lite-0.1.8.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pykvs_lite-0.1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / pykvs_lite-0.1.8.tar.gz
| Download URL | pykvs_lite-0.1.8.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a0d73b16147c04cade99344348d9dae7b186e768c0b413d90032a1b50453208
|
|
BLAKE2b-256 checksum How to use checksums |
eeb2153aa6dbf029f3dc96bf829876412e1e4e8afe1e5d1f5b23501409770dbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.12
|
Release files / pykvs_lite-0.1.8-py3-none-any.whl
| Download URL | pykvs_lite-0.1.8-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a8da45a6ffdb69bdf5e12f247627551d548696fbd67d8727a748d8ce19061f8
|
|
BLAKE2b-256 checksum How to use checksums |
f66de99b3595b768109ead0dd1c6c17ff1977d41b8db53a2e508c1e67b892fe1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.12
|