Easy-to-use synchronous/asynchronous key-value database backed by sqlite3.
Project description
Kvsqlite
Easy, Sample and powerful key-value database backed by sqlite3.
Features
- Fast and easy-to-use database
- Simultaneously asynchronous or synchronous calls
- Store any data supported by pickle
Requirements
- Python3.8+
Installation
pip install kvsqlite
From github (dev version)
pip install git+https://github.com/AYMENJD/Kvsqlite
Documentation
Kvsqlite documentation available at kvsqlite.rtfd.io.
Usage
from kvsqlite import Client # For sync version do: from kvsqlite.sync import Client
import asyncio
async def main():
async with Client("kv.sqlite") as db:
key = "123-456-789"
result = await db.set(key, "Hello world. Bye!")
if await db.exists(key):
get_key = await db.get(key)
print(get_key) # Hello world. Bye!
await db.delete(key)
await db.setex(key, "This key has a lifetime of 60 seconds", 60)
print(await db.get(key))
else:
print("Key not found", result)
asyncio.run(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Kvsqlite-0.2.1.tar.gz
(9.8 kB
view details)
File details
Details for the file Kvsqlite-0.2.1.tar.gz
.
File metadata
- Download URL: Kvsqlite-0.2.1.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d5626dc8c6a672c9c3f4143d43164ce2337aa161bef57e7397a5c663dc44017 |
|
MD5 | bd62f297d588d713d44b76ba296c889d |
|
BLAKE2b-256 | a41c8a3344b8d5a3397b25a1be7464edcb2263c2e4a168d411f8e3a357f3abc0 |