Skip to main content

Library for storing and retrieving state of Kelvin applications.

Project description

kelvin-app-storage

Redis-backed library for storing and retrieving state of Kelvin applications. Keys are automatically prefixed with the application name and version derived from app.yaml.

Prerequisites

A running Redis instance is required. For local development:

docker run -d --name redis -p 6379:6379 redis

Installation

uv sync

Usage

from kelvin_app_storage.client import StorageClient

client = StorageClient()

client.set("sensor_id", "abc-123")
client.get("sensor_id")       # "abc-123"
client.list_keys()             # ["myapp_1.0_sensor_id"]

To disable automatic key prefixing:

client = StorageClient(no_prefix=True)

Configuration

Environment Variable Default Description
KELVIN_APP_STORAGE_HOST kelvin-app-storage.app Redis host
KELVIN_APP_STORAGE_PORT 6379 Redis port
KELVIN_APP_STORAGE_PREFIX Derived from app.yaml Custom key prefix
KELVIN_APP_STORAGE_LOG_LEVEL INFO Log level (DEBUG or INFO)

app.yaml

The key prefix is derived from app.yaml in the working directory. Expected format:

info:
  name: myapp
  version: "1.0"

This produces the prefix myapp_1.0. If app.yaml is missing or unreadable, a random UUID is used as fallback.

Supported Value Types

str, int, float, bool, list, dict — complex types are serialized as JSON.

Running Tests

make test

Or directly with pytest:

uv run pytest tests/ -v

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

kelvin_app_storage-0.0.1-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file kelvin_app_storage-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: kelvin_app_storage-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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}

File hashes

Hashes for kelvin_app_storage-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e401942723bf4711cb1910ca234c97b1126b59e943fa982d571d20fa1ff58d93
MD5 ec3c25801916aa718143518e243ca36d
BLAKE2b-256 5d2577dbbe00de8d9b31e752f2d31484cee0f17549b1caf800f367a2e85f3557

See more details on using hashes here.

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