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.8.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.8.0
File Size Uploaded Provenance Actions
diskstore-0.8.0.tar.gz 202.8 kB With provenance Details for diskstore-0.8.0.tar.gz

Built distribution (wheel)

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

Total release size: 225.6 kB

Release files / diskstore-0.8.0.tar.gz

Download URL diskstore-0.8.0.tar.gz
Size 202.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b27821228852b919ddeb7c2502db9a28cb3532dbe01231de3e0fe74e5136deff
BLAKE2b-256 checksum
How to use checksums
2e93afb7dc364535c2ebb40909e5b5db123647af926e5ed516de293f3301d6c4
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 Nov 7, 2026.

Transparency log

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

Download URL diskstore-0.8.0-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
608f478c898f27c8fe53b7c6d431f1841c434f207b6eb2ff3f54fc671465b035
BLAKE2b-256 checksum
How to use checksums
5f0b1bfc861d5a79b0e9199df1f7ec04bf30986abad7e6bb91cfdd0147853164
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 Nov 7, 2026.

Transparency log

Security for diskstore 0.8.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.8.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 Nov 7, 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