Rest API and client for a server-side KV
Project description
Key-Value: REST
Implementation of the
KV[T]
async Key-Value ABC, over HTTP
(kv-api
)
pip install kv-rest
Client
from kv.rest import ClientKV
client = ClientKV('http://localhost:8000', Type=tuple[str, int])
await client.insert('hello', ('world', 42))
await client.keys()
# etc.
Server
import uvicorn
from kv.api import KV
from kv.rest import fastapi
kv = KV[tuple[str, int]] = ...
api = fastapi(kv)
uvicorn.run(api)
Server CLI
kv-rest path/to/kv.sqlite --host 0.0.0.0 --port 8000 --protocol sqlite
kv-rest path/to/kv --host 0.0.0.0 --port 8000 --protocol fs
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
kv_rest-0.1.11.tar.gz
(5.2 kB
view hashes)