skillfed

historydict

A persistent dictionary with history backed by sqlite

historydict v1.2.6 76.0K downloads/30d#14,660 on PyPI3
License unclear Abandoned released

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 historydict

uv

uv add historydict

poetry

poetry add historydict

Installing 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

persistent dictionary with historysqlite backed key-value storetrack configuration changesversioned dictionary storagekey-value history trackingmutable mapping with snapshots
audit-trailconfiguration-tracking

More Database packages