Skip to main content

Lightweight immutable key-value store using S3 versioning

Project description

ImmuKV - Python Client

Lightweight immutable key-value store using S3 versioning.

Installation

pip install immukv

Quick Start

from immukv import ImmuKVClient, Config

config = Config(
    s3_bucket="your-bucket",
    s3_region="us-east-1",
    s3_prefix=""
)

# Identity functions for JSON values (use custom encoders/decoders for complex types)
def identity(x): return x

with ImmuKVClient(config, identity, identity) as client:
    # Write
    entry = client.set("key1", {"value": "data"})
    print(f"Committed: {entry.version_id}")

    # Read
    latest = client.get("key1")
    print(f"Latest: {latest.value}")

    # List keys
    keys = client.list_keys(None, 100)

    # List keys with prefix filtering (server-side)
    sensor_keys = client.list_keys_with_prefix("sensor-", None, 100)

Features

  • Immutable log - All writes append to global log
  • Fast reads - Single S3 request for latest value
  • Hash chain - Cryptographic integrity verification
  • No database - Uses S3 versioning only
  • Auto-repair - Orphaned entries repaired automatically
  • Credential providers - Pluggable async credential refresh via CredentialProvider
  • Sync API - Synchronous interface backed by aiobotocore with a background event loop

Credential Providers

The client supports static credentials or an async credential provider for dynamic credential refresh (e.g., OIDC federation). The credential provider is backed by AioDeferredRefreshableCredentials for automatic refresh.

from immukv import ImmuKVClient, Config, S3Overrides, S3Credentials

# Static credentials
config = Config(
    s3_bucket="bucket",
    s3_region="us-east-1",
    s3_prefix="",
    overrides=S3Overrides(
        credentials=S3Credentials(
            aws_access_key_id="AKIA...",
            aws_secret_access_key="...",
            aws_session_token="...",
        ),
    ),
)

# Async credential provider
async def my_provider() -> S3Credentials:
    return S3Credentials(
        aws_access_key_id="AKIA...",
        aws_secret_access_key="...",
        aws_session_token="...",       # Optional
        expires_at=some_datetime,      # Optional (defaults to 1 hour from now)
    )

config_with_provider = Config(
    s3_bucket="bucket",
    s3_region="us-east-1",
    s3_prefix="",
    overrides=S3Overrides(credentials=my_provider),
)

See the full documentation for more details.

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

immukv-0.1.23.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

immukv-0.1.23-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file immukv-0.1.23.tar.gz.

File metadata

  • Download URL: immukv-0.1.23.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for immukv-0.1.23.tar.gz
Algorithm Hash digest
SHA256 88b7a298a4bda50f3f7015769de237b3d6b43086d7d2cc5d7e7974f0ee95bcc7
MD5 42c6c00ceb0b9a7a2fc2595360bbef55
BLAKE2b-256 5406cae1993509e15edd346e8531bf185de56988a06a16a68dfd1320d4092c90

See more details on using hashes here.

Provenance

The following attestation bundles were made for immukv-0.1.23.tar.gz:

Publisher: build.yml on Portfoligno/immukv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file immukv-0.1.23-py3-none-any.whl.

File metadata

  • Download URL: immukv-0.1.23-py3-none-any.whl
  • Upload date:
  • Size: 23.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for immukv-0.1.23-py3-none-any.whl
Algorithm Hash digest
SHA256 c8e13da5ddcb7c6099851303329258ca54c9ccef6b5bec72e7fc2e2135fb5868
MD5 22ae0b6dbdfc88d747be17f484d7ca66
BLAKE2b-256 c59ce7b1ab16cb0dfc57576b94f9fc75ef45a14484039ed57a1f1a493d70e884

See more details on using hashes here.

Provenance

The following attestation bundles were made for immukv-0.1.23-py3-none-any.whl:

Publisher: build.yml on Portfoligno/immukv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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