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.2.tar.gz (28.7 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.2-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: livedict-2.0.2.tar.gz
  • Upload date:
  • Size: 28.7 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.2.tar.gz
Algorithm Hash digest
SHA256 f613522f22e41688fd045cb0eebb1f82b7eecf904f11b5f431a16fc3ace379c0
MD5 da7efb0b2afd46191fa91c0626384468
BLAKE2b-256 fd7b605fd2f134b7770c87675edb8091936b4b2c6eecbb3f5d5bc337f5405178

See more details on using hashes here.

File details

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

File metadata

  • Download URL: livedict-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 30.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6bbc875ba75be4fc75abc26ee35c7e2f293a92d7a15f0c68e25d4b8af173a2b
MD5 8321951e5b2d6cd7a6c733a8f6e89b24
BLAKE2b-256 2fe8c7d5e942ee6884f1fb0e390c845c97d74c8785430dbb50afb157f70cd8dd

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