A simple key-value database in python.
Project description
A simple key-value database in python.
Install
pip install pykvdb
Usage:
import pykvdb
import os
# set db file path, default is './pykvdb'
dbpath = os.path.join(os.path.split(os.path.realpath(__file__))[0], 'pykvdb')
# set db file maxsize, default is 10M
dbsize = 10 * 1024 * 1024
with pykvdb.KVDB(path=kvpath, size=dbsize) as kv:
kv.set('a', 'test')
# get value
with KVDB(path=kvpath, size=dbsize) as kv:
print(kv.get('a'))
# scan all key-value
with KVDB(path=kvpath, size=dbsize) as kv:
cur = kv.cursor()
for k, v in cur:
print(k.decode(), v.decode())
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
pykvdb-0.1.0.tar.gz
(3.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pykvdb-0.1.0.tar.gz.
File metadata
- Download URL: pykvdb-0.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6c59767d34681d0dac17d9535c2dc864e0343fffd17ee0b505458d0d3d0d1be
|
|
| MD5 |
56646985ad10465ee2d0b7d78804438e
|
|
| BLAKE2b-256 |
a40ff5ffbe42fd24c76c5059bb9b3ab64d937df5e2267df0934a2b2da3748f2a
|
File details
Details for the file pykvdb-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: pykvdb-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fa4cd879be4f570422aa6e9b32084bb936e0e5dc6a575e2d0710b37e6dc1038
|
|
| MD5 |
125703cde1e7a68c5930fdfbe855ffe2
|
|
| BLAKE2b-256 |
c0055a465df463e80c3dded75c63f5c1bec6144cfd0c4e644adc1e3ee8263698
|