A simple key-value database in python.
Project description
A simple key-value database in python.
Installation
pip install pykvdb
Usage:
from kvdb import KVDB
import os
# set db file path, default is './pykvdb'
dbpath = os.path.join(os.path.split(os.path.realpath(__file__))[0], 'kvdb')
# set db file maxsize, default is 10M
dbsize = 10 * 1024 * 1024
with 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.1.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.1.tar.gz.
File metadata
- Download URL: pykvdb-0.1.1.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 |
2af17a2742e4ec4490c8e435e27a1f2f54119d529e403d2bd28ba64ed88bcbb7
|
|
| MD5 |
e288b4b1b02690229f877f50518043c6
|
|
| BLAKE2b-256 |
a5d7132fb9cc9afd262c9368a4f8a1a13a1d1dd01a6eb51873cb3382625ce506
|
File details
Details for the file pykvdb-0.1.1-py2.py3-none-any.whl.
File metadata
- Download URL: pykvdb-0.1.1-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 |
fa68f295dd0bdebd566bce4a4176924c9ca1c3dc6fef0f122b9497c251b601ec
|
|
| MD5 |
59b15fa9c9e0d33ef65fe1643c8d3d17
|
|
| BLAKE2b-256 |
deea9f503a3a83d6aff5acf7181d42872d626c45b7fb99600f0454357a4677c5
|