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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file kv_rest-0.1.11.tar.gz.

File metadata

  • Download URL: kv_rest-0.1.11.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for kv_rest-0.1.11.tar.gz
Algorithm Hash digest
SHA256 cf8c2785ad465c1f7cf0af6140cfc8e2328d3e945c2d6c85dc14fb29e94d48da
MD5 232811b0b4ccf5854ab7a74ad1582f5a
BLAKE2b-256 cbad8a1577efefa3e9d004a5d3d271fea2ab7ac70a64f2a63ed61b6c508d7bed

See more details on using hashes here.

File details

Details for the file kv_rest-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: kv_rest-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for kv_rest-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 799a9a5c9a7624988e1da4f8d59352a7896d7886f2cc87f239b1d109c573e599
MD5 b9a3cd18e0b51a5630643d991b0b8458
BLAKE2b-256 88b6abb67a92c996d0f3a53e59380e6cd181543d9f8a1da83ec50f6fabbe03a6

See more details on using hashes here.

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