Skip to main content

Simple MutableMapping compatible SQLite based disk storage.

Project description

DiskStore Sqlite based disk store

DiskStore is an Apache2/MIT 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.

Features

  • Pure-Python
  • nearly 100% test coverage
  • Performance matters
  • Thread-safe and process-safe
  • Developed on Python 3.10
  • Tested on CPython 3.10, 3.11, 3.12, 3.13, 3.14, 3.15
  • Tested using GitHub Actions

Quickstart

Installing DiskStore:

$ uv pip install diskstore

or

$ uv add diskstore

There are three basic storage classes available. DiskStore, DiskRead and DiskCache.

User Guide

Work in progress, look at unit tests for examples.

Example:

from diskstore import DiskStore

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

Everything is mostly stable and test coverage is nearly 100%. Documentation is missing.

Timings

These are rough measurements. Compared to Diskcache library.

Diskstore library:

set: 28.8 µs get: 3.23 µs set/delete: 84 µs

Diskcache library:

set: 196 µs get: 15.5 µs set/delete: 535 µs

Why is the Diskstore library faster than others. Every overhead is eliminitated and it uses the faster sqlite library apsw with up to date sqlite library version.

License

Copyright 2025-2026 Wolfgang Langner

Licensed under the Apache License, Version 2.0 (the "License") or MIT; you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
https://mit-license.org/

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diskstore-0.2.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diskstore-0.2.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file diskstore-0.2.0.tar.gz.

File metadata

  • Download URL: diskstore-0.2.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for diskstore-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2fe6ef4aa28e11fd58b51caf78748c7a78f63b7f6682539fd132875271c9c2fa
MD5 8eeeeac3099d51ad46a2634dd81aa3fd
BLAKE2b-256 4d185c886565228f227dedd521a512d8d9791e3bdc7d84faab9d2e7d25b29c3a

See more details on using hashes here.

Provenance

The following attestation bundles were made for diskstore-0.2.0.tar.gz:

Publisher: publish.yml on tds333/diskstore

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file diskstore-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: diskstore-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for diskstore-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8ccd8313968d0b2bbb1c669d0b2629acba832c5551befe822ac9cd5bbe09abe
MD5 f511b2cbe97987b6bb2f3c6e2c969d79
BLAKE2b-256 de40aabe514f009f50d8614bf3f231b1521ce62e024e13711ed03a018ec3dd40

See more details on using hashes here.

Provenance

The following attestation bundles were made for diskstore-0.2.0-py3-none-any.whl:

Publisher: publish.yml on tds333/diskstore

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page