historydict
A persistent dictionary with history backed by sqlite
What it is and what it does
HistoryDict is a lightweight wrapper around SQLite that presents a dictionary-like interface while automatically recording every value change for each key. You interact with it using standard dictionary syntax or the `past()` method to retrieve previous values by depth (1 step back, 2 steps back, etc.). All MutableMapping methods are supported, making it a drop-in replacement for a regular dict when you need to track configuration drift or audit value changes over time.
The package stores values as JSON blobs in SQLite, so only JSON-serializable data can be persisted. Keys are hashed for storage, which creates a known limitation: keys with unstable string representations (like dicts in Python 3) may collide. The library has no external runtime dependencies and installs cleanly, but it has been abandoned since August 2023 with no ongoing maintenance.
Use it for:
- Track configuration parameter changes over time in long-running applications or services.
- Audit trail for user-editable settings where you need to know what changed and when.
- Lightweight versioning of simple data structures without committing to a full database schema.
- Development debugging: store intermediate state snapshots to replay or inspect past values.
- Configuration rollback scenarios where you need to recover a previous known-good state.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
HistoryDict provides a persistent dictionary backed by SQLite that tracks the complete history of value changes for each key, allowing you to retrieve both current and past values.
Yes, if you need lightweight history tracking for simple JSON-serializable data and can tolerate an abandoned package. The core functionality is stable and has no known vulnerabilities, but do not rely on it for new projects requiring active maintenance or Python version support. Verify the license before using in proprietary code.
Install
historydict on PyPI
pip
pip install historydictuv
uv add historydictpoetry
poetry add historydictInstalling historydict
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned—last updated in August 2023 with no recent maintenance activity—so expect no bug fixes or updates for new Python versions.
License in practice
License status is unclear; no SPDX identifier or raw license text is declared. Before using in production or proprietary code, verify the actual license terms in the repository.
Quickstart
from historydict import HistoryDict
hist = HistoryDict('/tmp/mydict')
hist['key'] = 'value1'
hist['key'] = 'value2'
print(hist['key']) # 'value2'
print(hist.past('key', 1)) # 'value1'
Values must be JSON-serializable (no NumPy arrays or custom objects); keys must have stable, unique string representations to avoid hash collisions in Python 3.
Verify before relying
- Whether the package works with modern Python versions (3.10+) given its abandoned status.
- Actual license terms and whether redistribution is permitted.
- Performance characteristics with large histories or frequent updates.
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,105 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 76,016/month — #14,660 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: historydict-1.2.6-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
sqlitedictProvides a dict-like interface to SQLite…
permissive · top 5,000 on PyPI
seba-sqliteProvides legacy SQLite storage backend for the…
copyleft · top 15,000 on PyPI
sqlalchemy-jsonProvides mutation-tracked JSON column types for…
permissive · top 5,000 on PyPI
speedictSpeeDict is a Python key-value storage library…
permissive · top 15,000 on PyPI
rocksdictRocksDict provides a Python interface to…
permissive · top 15,000 on PyPI
diskcacheDiskCache provides a pure-Python disk-backed…
permissive · top 1,000 on PyPI
langgraph-checkpoint-sqliteProvides a SQLite-backed checkpoint saver for…
permissive · top 5,000 on PyPI
attrdictProvides dictionary-like objects that allow…
permissive · top 5,000 on PyPI
recordtyperecordtype creates mutable record classes with…
permissive · top 15,000 on PyPI
lmdbProvides a Python binding to LMDB (Lightning…
unclear · top 5,000 on PyPI