Skip to main content

DiskStore Sqlite based disk store

DiskStore is a BSD-3-Clause licensed disk storage library, written in pure Python.

Inspired by DiskCache library it implements a MutableMapping compatible sqlite based disk storage. Easy interface and very fast. Keys can be of basic sqlite storage classes defined by Python types int, float, str, bytes. Values can be of basic sqlite type or with custom configuration, supporting dataclasses, structtype, pydantic, ...

Features

  • Pure-Python
  • 100% test coverage
  • Performance matters
  • Thread-safe and process-safe
  • Tested on CPython 3.10, 3.11, 3.12, 3.13, 3.14, 3.15
  • Optional performance-improved implementation based on APSW.

Quickstart

Installing DiskStore:

$ uv pip install diskstore

or

$ uv add diskstore

There are two basic storage classes available: DiskStore and DiskRead. Serialisation is controlled by the config classes in diskstore.config (BaseConfig, JsonConfig, NamedTupleConfig, DataclassConfig, PydanticConfig and StructtypeConfig).

User Guide

Example:

from diskstore import DiskStore

ds = DiskStore("/tmp/diskstore.db")
ds["key"] = "my value"
print(ds["key"])

See the docs/ directory for the user guide and API reference, or read the online documentation.

Timings

Rough measurements against diskcache.Index on the same machine (Python 3.14.9, 1 KB values, 100 000 operations, one process, median per operation):

Operation diskstore (sqlite3) diskstore (apsw) diskcache
get 3.8 µs 3.6 µs 4.3 µs
set 3.1 µs 2.9 µs 26.0 µs
delete 18.6 µs 21.0 µs 20.3 µs

Run make bench to reproduce. DiskStore is faster because per-operation overhead is eliminated and the SQL statements are optimised. If APSW is installed (pip install diskstore[apsw]) it is used automatically for further performance improvements.

License

DiskStore is distributed under the terms of the BSD-3-Clause license.

Copyright 2025-2026 Wolfgang Langner

Metadata

Release files for diskstore 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for diskstore 0.7.0
File Size Uploaded Provenance Actions
diskstore-0.7.0.tar.gz 199.0 kB With provenance Details for diskstore-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for diskstore 0.7.0
File Interpreter ABI Platform Actions
diskstore-0.7.0-py3-none-any.whl Python 3 none any Details for diskstore-0.7.0-py3-none-any.whl

Total release size: 221.2 kB

Release files / diskstore-0.7.0.tar.gz

Download URL diskstore-0.7.0.tar.gz
Size 199.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fbc30b90adb6ea448bfc377a4296a5fd0f523ef06d28913331b0f967de3c6ae8
BLAKE2b-256 checksum
How to use checksums
e9ff957f9c6aa2fb8e3d94ed17e34bdc60680d8b242eb78e434f93a6f4088e17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / diskstore-0.7.0-py3-none-any.whl

Download URL diskstore-0.7.0-py3-none-any.whl
Size 22.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
336d6df493263d8dba30fea50bb59d0e4e0acc9d64c3ce56891b45aef87df543
BLAKE2b-256 checksum
How to use checksums
9cb671488ba2d80878182348ad93ec492081fba34d22c5699f36d81d25ec5248
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for diskstore 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for diskstore-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page