Skip to main content

TTL-based key-value store with sandboxed hooks and (optionally) persistence backends (SQLite/Memory/Redis).

Project description

LiveDict (Release v1.0.4)

TTL-based, (optionally) Persistent Python Dictionary with Hook Callbacks

LiveDict is a secure, extensible, and ephemeral key-value store designed for applications that need in-memory caching with optional persistence and encryption.

Highlights

  • AES-GCM encryption (via cryptography) with a deterministic fallback for test environments.
  • TTL expiry driven by a heap-based monitor thread for efficient scheduling.
  • Optional persistence backends:
    • SQLite (file-backed DB)
    • File-backed object store (per-bucket files)
    • Redis (thin wrapper; requires redis package)
  • Hook callbacks (on_access, on_expire) executed safely (sandboxing recommended).
  • Pydantic-backed configuration models for clarity and validation.
  • Bucket policies and limits to control memory usage and namespaces.

LiveDict (Release v2.0.0)

LiveDict is a small utility library providing in-memory dictionary-like structures with synchronous and asynchronous variants, a sandbox module, and flexible storage backends.

Important changes in v2

  • Cryptography removed: the package no longer performs encryption. Users must provide their own cryptographic handling.
  • Sandbox is active: behaves as implemented in livedict/modules/sandbox.py.

Sandbox usage

Review livedict/modules/sandbox.py for details. The sandbox module is included and active; exercise caution and review its behavior before running untrusted code.


License

MIT License. © 2025 LiveDict. All rights reserved.

GitHub license

Installation

Minimum supported Python: 3.8+

Install with:

pip install livedict

Demonstration

Visit testfile.py as a demonstration on how to use LiveDict.


Contributing

  • Generate documentation using your preferred tools (pdoc, Sphinx with napoleon for Google-style).
  • This release uses Google-style docstrings across the codebase.

About License:

  • SPDX-License-Identifier: MIT
  • Copyright (c) 2025 Hemanshu

If you want to credit LiveDict in your docs/acknowledgements, this short line works:

LiveDict - TTL-based Python key-value store by hemanshu03. Find LiveDict on GitHub @LiveDict


If you find LiveDict useful and want to support continued development:

Consider sponsoring the project: LiveDict

===

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

livedict-2.0.1.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

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

livedict-2.0.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file livedict-2.0.1.tar.gz.

File metadata

  • Download URL: livedict-2.0.1.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for livedict-2.0.1.tar.gz
Algorithm Hash digest
SHA256 0fc83aced3aedee79cdfef5aa685f09f4f3df2588b318e3dec4838e7298e274f
MD5 76e79762f4ad27a936afb406b7f2aa30
BLAKE2b-256 43d1cf098be905bfe8d978a3e03684e6fcaf76fd8ed372597ba3257133ce26de

See more details on using hashes here.

File details

Details for the file livedict-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: livedict-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for livedict-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 17ae93cc9454975bb06c9ede59e26ddcdd4e31f6109a1ddf907a119d08e57fd3
MD5 9819a43875d16169f7fe454d70bbccad
BLAKE2b-256 4fb46eb35b92342b2d8e0c04eac27f9b88ab65d067717bcb90c443f8312d8b08

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