skillfed

sqlitedict

Persistent dict in Python, backed up by sqlite3 and pickle, multithread-safe.

sqlitedict v2.1.0 1.8M downloads/30d#3,519 on PyPI1,244
Permissive license Apache 2.0 Abandoned released

What it is and what it does

SqliteDict wraps Python's sqlite3 module to present a persistent dictionary interface backed by SQLite files. Instead of storing data in RAM, you get a dict-like object that reads from and writes to a SQLite database, making it suitable for caching, configuration storage, or small-to-medium persistent key-value needs that don't require a separate database server.

The package handles serialization (pickle by default, but JSON or custom codecs are supported), supports multiple named tables in a single database file, and provides multi-threaded access by serializing concurrent writes internally. Keys are strings; values can be any picklable Python object. You must explicitly call commit() to persist changes unless autocommit mode is enabled.

Use it for:

  • Cache application state or computed results to disk without running a separate database service.
  • Store configuration or session data as Python objects without manual serialization.
  • Persist large collections that exceed available RAM by using SQLite's disk-backed storage.
  • Share data across multiple threads in the same process while avoiding sqlite3's thread-safety limitations.
  • Prototype or test applications that need persistent storage before migrating to a full database.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a dict-like interface to SQLite databases, allowing you to store and retrieve Python objects persistently with multi-threaded access support.

No. The package is abandoned (last commit 1350 days ago) with two unpatched known vulnerabilities and no maintenance signal. While the code is stable for simple use cases, the lack of active maintenance and security patches makes it unsuitable for new projects or production systems. Consider alternatives like `shelve` (stdlib), `diskcache`, or a proper database library instead.

Install

sqlitedict on PyPI

pip

pip install sqlitedict

uv

uv add sqlitedict

poetry

poetry add sqlitedict

Installing sqlitedict

Before you install

High install friction with no runtime dependencies. The package is marked abandoned (last commit 2022-12-07, 1350 days ago) despite being marked Production/Stable. Two known vulnerabilities (GHSA-g4r7-86gm-pgqc, PYSEC-2026-1939) are unpatched.

License in practice

Apache 2.0 is permissive; you can use this in commercial projects and modify it freely, but must include a copy of the license and state significant changes.

Quickstart

from sqlitedict import SqliteDict

db = SqliteDict('example.sqlite')
db['key'] = {'data': 'value'}
db.commit()
print(db['key'])
db.close()

Requires explicit commit() calls to persist changes unless autocommit=True is set; uncommitted data is lost on close.

Verify before relying

  • Whether the two known vulnerabilities (GHSA-g4r7-86gm-pgqc, PYSEC-2026-1939) affect your use case or have workarounds.
  • Current maintenance status and whether the project has been forked or adopted elsewhere.
  • Performance characteristics with large databases or high write concurrency in your specific workload.

Package facts

License Apache 2.0 (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 1,350 days since the last release
Last repo commit
First released
Downloads 1,818,385/month — #3,519 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities 2 — GHSA-g4r7-86gm-pgqc, PYSEC-2026-1939

Evidence: sqlitedict-2.1.0.tar.gz

Keywords: sqlite, persistent dict, multithreaded

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Database :: Front-Ends

Tags

sqlite persistent dictionarypython dict backed by sqlitethread-safe sqlite storagelightweight sqlite wrapperpickle serialization sqlitemulti-table sqlite dictin-process key-value store
persistent-storagesqlite-wrapperabandoned

More Front-Ends packages