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. Value is a Namedtuple class
with same basic Python types.
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, Value
ds = DiskStore("/tmp/diskstore.db", value_class=Value)
ds["key"] = Value("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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diskstore-0.1.0.tar.gz.
File metadata
- Download URL: diskstore-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57235d7c8e84b61ba228b06cffe3d279447b5e8bfbac995d65714e3704300c43
|
|
| MD5 |
84f3d3aa34ffb1e942d986d466f875da
|
|
| BLAKE2b-256 |
e4d459640a4c1c99029dc8bc44c621c4377da52801dcd5ee99068e7983afe172
|
File details
Details for the file diskstore-0.1.0-py3-none-any.whl.
File metadata
- Download URL: diskstore-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f78db646b7a4453ef55f927eb5171eeb515eea018c43d69fe5970a5ec11c36c6
|
|
| MD5 |
5e2b6590a21d488f2ef0c20decf45b5b
|
|
| BLAKE2b-256 |
1f52e4a1ad6da39ff0cb19dd619363ba5ec94a3fb51514909201f94610e61ecc
|