TKV - Temporal Key-Value Store
A key-value store that supports timestamp-based queries, allowing you to retrieve values as they existed at specific points in time.
Features
- Temporal queries: Get the value for a key at the largest timestamp less than or equal to your query timestamp
- Multiple backends: SQLite as default, Redis and RocksDB as experimental alternatives
- REST API: FastAPI-based web interface
- CLI interface: Command-line tools for direct interaction
Project Layout
src/
├── service.py # Core backend store implementations
├── api.py # FastAPI web server
└── cli.py # Command-line interface
The primary interest is service.py, which contains the main backend store implementation using SQLAlchemy/SQLite, as well as experimental alternatives using Redis and RocksDB. The CLI and API are implemented separately as distinct interfaces to the core functionality.
Prerequisites
- Python 3.12+
Installation
From PyPI (Recommended)
pip install tkv
Development with uv
First install uv:
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Then clone the repository and sync dependencies:
git clone https://github.com/JackismyShephard/tkv.git
cd tkv
uv sync
Usage
CLI
# Store a value
tkv put mykey myvalue 1000
# Retrieve a value
tkv get mykey 1500
Web API
Start the server:
tkv-web run
Store data:
curl -X PUT http://localhost:8000/ \
-H "Content-Type: application/json" \
-d '{"key":"mykey","value":"myvalue","timestamp":1000}'
Retrieve data:
curl "http://localhost:8000/mykey?timestamp=1500"
Development
uv sync --group dev
Running Commands
# CLI commands
uv run tkv put mykey myvalue 1000
uv run tkv get mykey 1500
# Web server
uv run tkv-web run
Testing
uv run pytest
Metadata
Release files for tkv 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tkv-0.1.4.tar.gz | 15.6 kB | Without provenance | Details for tkv-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tkv-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for tkv-0.1.4-py3-none-any.whl |
Total release size: 26.7 kB
Release files / tkv-0.1.4.tar.gz
| Download URL | tkv-0.1.4.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
601bef5e2ae9a4fe927ab006b79296dbc24bbdb242eeb179c4ab55d077ac2775
|
|
BLAKE2b-256 checksum How to use checksums |
def9d8595d542518e32a857eb3c3dcf71e6c99a8d5f99888e7d7ec8336d08355
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.0
|
Release files / tkv-0.1.4-py3-none-any.whl
| Download URL | tkv-0.1.4-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91afbe384da9dc6a3ea7ab91ff48ab5e1c0fe3867e0ddf74e2a7dc2e26289a3f
|
|
BLAKE2b-256 checksum How to use checksums |
ce099c8acd47e0360b6970dfaa6ad98b308e7a4b58632996b0ea742381dcdea7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.0
|
Security for tkv 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.