https://github.com/aymenjd/kvsqlite
Easy-to-use key value database backed by SQLite.
https://github.com/aymenjd/kvsqlite
asyncio database easy-to-use key-value-database pypi python python3 redis sqlite3
Last synced: 18 days ago
JSON representation
Easy-to-use key value database backed by SQLite.
- Host: GitHub
- URL: https://github.com/aymenjd/kvsqlite
- Owner: AYMENJD
- License: mit
- Created: 2023-02-08T04:19:40.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-07T10:17:28.000Z (over 1 year ago)
- Last Synced: 2024-12-15T06:18:39.819Z (over 1 year ago)
- Topics: asyncio, database, easy-to-use, key-value-database, pypi, python, python3, redis, sqlite3
- Language: Python
- Homepage: https://kvsqlite.rtfd.io
- Size: 70.3 KB
- Stars: 15
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kvsqlite [](https://pypi.org/project/Kvsqlite) [](https://pepy.tech/project/Kvsqlite)
Easy, Simple 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**](https://docs.python.org/3/library/pickle.html)
### Requirements
- Python3.8+
### Installation
```bash
pip install kvsqlite
```
From github (dev version)
```bash
pip install git+https://github.com/AYMENJD/Kvsqlite
```
### Documentation
[Kvsqlite](https://github.com/AYMENJD/Kvsqlite) documentation available at [kvsqlite.rtfd.io](https://kvsqlite.rtfd.io/).
### Usage
```python
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, 60, "This key has a lifetime of 60 seconds")
print(await db.get(key))
else:
print("Key not found", result)
asyncio.run(main())
```