Skip to main content

thunderstrike

Python client for the thunderstrike key-value database: a pool of pipelined TLS 1.3 connections behind a small blocking API.

The wheel carries the compiled client library. Nothing to compile on install, and no dependencies beyond the standard library (it uses ctypes).

Install

pip install thunderstrike

Python 3.8 or newer, on Linux x86-64 / ARM64 (glibc 2.17 or newer) or Windows x86-64. macOS wheels come in a later release.

Quick start

The server speaks TLS 1.3 only. The client needs the CA certificate that issued the server's certificate (docker/tls/ca.crt in the server's kit) and a DNS name that certificate carries (localhost unless the server was set up with other THUNDERSTRIKE_TLS_NAMES).

from thunderstrike import Thunderstrike

with open("ca.crt", "rb") as f:
    ca = f.read()

with Thunderstrike("127.0.0.1:7380",
                   tls_server_name="localhost",
                   tls_ca_pem=ca) as db:
    db.set(b"user:1", b"ada")
    print(db.get(b"user:1"))   # b'ada'
    print(db.get(b"nope"))     # None

Give it one address. The client asks that server for the cluster layout and connects to every core (core c listens on port 7380 + c), so those ports must be reachable too.

tls_server_name is sent as SNI and checked against the certificate, so it is the name the certificate was issued for, not necessarily the host you dial. There is no way to turn verification off.

Operations

Keys and values are bytes. A key is at most 65,535 bytes; an empty value is refused. Keys do not expire: a value stays until it is deleted or overwritten.

db.set(b"k", b"v")
db.get(b"k")                 # b"v", or None when absent
db.get(b"k", b"fallback")    # a default for a miss
db.exists(b"k")              # True / False
db.append(b"k", b"-more")    # appends (creates if absent); returns the new length
db.delete(b"k")              # True if it was there
db.ping()

# Mapping-style access
db[b"k"] = b"v"
value = db[b"k"]             # raises NotFound on a miss
del db[b"k"]                 # raises NotFound on a miss
b"k" in db                   # exists()

Batches

For more than one key, use the batch calls. They put every request on the wire before waiting for any answer, so n keys cost one round trip instead of n.

db.mset({b"a": b"1", b"b": b"2"})           # or a list of (key, value) pairs
db.mget([b"a", b"b", b"missing"])            # [b"1", b"2", None]
db.mdelete([b"a", b"b", b"missing"])         # [True, True, False]

Threads

One Thunderstrike instance is safe to share across threads, and should be: it is a connection pool. The GIL is released during every call, so a thread waiting on the server does not block the others. The API is blocking; there is no asyncio interface in this release (run calls in a thread pool from async code).

Errors and retries

Every failure raises ThunderstrikeError (or a subclass) with:

  • code: the numeric status (positive from the server, negative from the client).
  • retry_class: whether sending the request again is sound.
  • detail: the specific cause when there is one, e.g. the TLS reason.
retry_class meaning
thunderstrike.RETRY_ALWAYS Busy: the server did not apply it. Retry anything after a short backoff.
thunderstrike.RETRY_IF_IDEMPOTENT A lost connection or a timeout: the outcome is unknown. Repeat get, set, exists and ping only.
thunderstrike.RETRY_NEVER Everything else.

The client has already retried Busy answers (every operation but delete) and dropped connections (idempotent operations) before it raises.

Subclasses: NotFound, Timeout, Disconnected, Closed, Busy, ServerOutOfMemory, StorageExhausted, ServerError, TlsError.

import thunderstrike

try:
    db.set(b"k", b"v")
except thunderstrike.Busy:
    ...  # not applied; safe to try again later
except thunderstrike.ThunderstrikeError as e:
    print(e.code, e.retry_class, e.detail)

Configuration

All keyword-only, all optional except the TLS pair:

option meaning
tls_server_name, tls_ca_pem TLS 1.3: the certificate's name and the CA (PEM, bytes or str). Give both.
tls_client_cert_pem, tls_client_key_pem Client certificate (mTLS), for a server that requires one.
request_timeout_ms Per-request deadline, covering retries. Default 60000; 0 disables it.
connect_timeout_ms Connect and TLS handshake deadline.
connections_per_endpoint TCP connections per server core.
max_inflight Pipeline depth per connection.
max_retries Retries for an idempotent request whose connection dropped.
busy_retries, busy_backoff_ms=(min, max), busy_retry_window_ms Busy retry policy. Defaults 4, (2, 200), 5000.
max_response_bytes Largest response the client will accept.
tcp_keepalive_ms, tcp_nodelay Socket options.
min_io_threads, max_io_threads Bounds on the client's I/O threads.

db.stats() returns pool counters (connections, requests, bytes, reconnects). db.endpoints() is the number of server cores connected, db.shards() the number of shards.

The library loads from inside the package. To use another build, set THUNDERSTRIKE_CLIENT_LIB to its path.

License

Proprietary, free to use: see the LICENSE file shipped in the package. You may build this library into your own applications and ship it as part of them.

Copyright (c) 2026 SHORTSQUEEZE PRIVATE LIMITED.

Metadata

Release files for thunderstrike 0.1.3

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

Built distributions (wheels)

Table of built distributions (wheels) for thunderstrike 0.1.3
File Actions
thunderstrike-0.1.3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for thunderstrike-0.1.3-py3-none-win_amd64.whl
thunderstrike-0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for thunderstrike-0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
thunderstrike-0.1.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for thunderstrike-0.1.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
thunderstrike-0.1.3-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for thunderstrike-0.1.3-py3-none-macosx_11_0_arm64.whl
thunderstrike-0.1.3-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for thunderstrike-0.1.3-py3-none-macosx_10_12_x86_64.whl

Total release size: 2.9 MB

Release files / thunderstrike-0.1.3-py3-none-win_amd64.whl

Download URL thunderstrike-0.1.3-py3-none-win_amd64.whl
Size 596.9 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
af4851572395e0b20dd7c5cb58d6cb658dd4ae0c8dd723876acc1f1754e67ea1
BLAKE2b-256 checksum
How to use checksums
c4e4c209af0795dc13055227efee57b9201394132ec37d762394f7734d8f346e
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 29, 2026.

Transparency log

Release files / thunderstrike-0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL thunderstrike-0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 614.1 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
5d9f0686d23ac5794f1ca50d2e278fa09e66c6638469f0bdc54519ca52b4198f
BLAKE2b-256 checksum
How to use checksums
283ff6503b103051f48cf67518ad96e9d97c6e10c997738732e754cc60ab4050
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 29, 2026.

Transparency log

Release files / thunderstrike-0.1.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL thunderstrike-0.1.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 591.3 kB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e42e44f19e5cdf3e2f21321945faf619c30f74f148472942da9b34cd073cca33
BLAKE2b-256 checksum
How to use checksums
06a4960073239ed6238ebb7ef94622cb349432659c9f6d5148763c2fa2af1992
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 29, 2026.

Transparency log

Release files / thunderstrike-0.1.3-py3-none-macosx_11_0_arm64.whl

Download URL thunderstrike-0.1.3-py3-none-macosx_11_0_arm64.whl
Size 512.2 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
9e7ff89ac21b098cc4f2624a90e9a1e12525c329b87660ae869833ea3a1ff924
BLAKE2b-256 checksum
How to use checksums
d1f71a53cce26a68defb8b71d25a22cf437c874cd7b2bf848763054e155de754
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 29, 2026.

Transparency log

Release files / thunderstrike-0.1.3-py3-none-macosx_10_12_x86_64.whl

Download URL thunderstrike-0.1.3-py3-none-macosx_10_12_x86_64.whl
Size 571.8 kB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
243b43ec7d78ed50fdcd4391092d117a5655b2d52bd33b8780205f4533fbb4e8
BLAKE2b-256 checksum
How to use checksums
8c1e4dd051645c5e98df3ca6adf35c3f080f7c39821e12ad7b7958c8e2ee5738
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 29, 2026.

Transparency log

Security for thunderstrike 0.1.3

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

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for thunderstrike-0.1.3-py3-none-win_amd64.whl

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 29, 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