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.0.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.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: livedict-2.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 49e19d6b7c1cfea65a251de3dc8c28690369eae17017c6d1afc723acc5f112a3
MD5 3bd57c5991da8d2b187eba9ef4a330dd
BLAKE2b-256 e1388963512850d4b8cf8483ef1c3d5e4f5cd8ce0a3af242a0b7291d1d6f49b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: livedict-2.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf8de5e42bc896bf135a5e2f55be9ed65e5bb7e97520662230300d24e9ef7627
MD5 80024a3844851ac5e045f640b83db943
BLAKE2b-256 3d3554c09aeade9d940ef06c57aa5515509a3d899fe6ef0e7eb4a5bda950ce9c

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