Skip to main content

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


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)

Uploaded Source

Built Distribution

kv_rest-0.1.11-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page