Skip to main content

cliffracer-kv

NATS JetStream Key-Value and Object Store integration extension for Cliffracer services.

Overview

cliffracer-kv provides NATS Key-Value and Object Store integration for Cliffracer services:

  • Service Extension (KvExtension): Declaratively bound to self.kv on your service.
  • Bucket Auto-Provisioning: Automatic creation of KV buckets and Object Stores with configurable options.
  • Bucket-Level TTL: Direct support for bucket-level TTL configurations (ttl parameter passed to JetStream bucket creation).
  • Serialization: Automatic serialization and deserialization for Pydantic models, JSON dictionaries, lists, strings, and raw bytes.
  • Optimistic Concurrency: Supports revision-based updates and optimistic concurrency control.
  • Object Store Support: Support for storing, retrieving, deleting, and listing large objects via NATS ObjectStore.

Installation

uv add cliffracer-kv

Usage

from pydantic import BaseModel
from cliffracer import CliffracerService
from cliffracer_kv import KvExtension, BucketConfig

class UserProfile(BaseModel):
    name: str
    email: str

class UserService(CliffracerService):
    kv = KvExtension(
        buckets=[
            BucketConfig(name="profiles", ttl=3600),
            "sessions",
        ],
        bucket_ttls={"sessions": 86400},
        object_stores=["media-assets"],
    )

    async def save_profile(self, user_id: str, profile: UserProfile):
        revision = await self.kv.put("profiles", user_id, profile)
        return {"saved": True, "revision": revision}

    async def get_profile(self, user_id: str) -> UserProfile | None:
        return await self.kv.get("profiles", user_id, as_type=UserProfile)

Metadata

Release files for cliffracer-kv 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cliffracer-kv 1.0.0
File Size Uploaded Provenance
cliffracer_kv-1.0.0.tar.gz 12.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cliffracer-kv 1.0.0
File Interpreter ABI Platform
cliffracer_kv-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.5 kB

Release files / cliffracer_kv-1.0.0.tar.gz

Download URL cliffracer_kv-1.0.0.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
36bcb5e1d7de9210d2b4512f29f220cfc4cacf08bd9aac0d4d405e81f58f02c8
BLAKE2b-256 checksum
How to use checksums
6c068f04161ce51a3dc7dd17185a9c5fdb55298ef829343c0976cbba6806e12f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cliffracer_kv-1.0.0-py3-none-any.whl

Download URL cliffracer_kv-1.0.0-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffc39397967b3430dd9358e53473d3754bcd0a8dbeda1b6b742ff1297ce73c23
BLAKE2b-256 checksum
How to use checksums
b18fed2a80522e168c575346ec3f47fede7a1a16f8b85b32ed6837bed5a914d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cliffracer-kv 1.0.0

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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page