Skip to main content

Hardcharger™

PyPI Downloads PyPI: hardcharger PyPI: adbc-driver-hardcharger Hardcharger Chargewire protocol Apache 2.0 license GizmoData

hardcharger

Run Hardcharger, GizmoData's DuckDB 2.0 server, from Python. The package has no dependencies: on first use it downloads the hardcharger-server release for your platform (Linux x86-64 and arm64, macOS on Apple silicon), checks it, caches it, and runs it as a subprocess. That makes a real server one line away in tests, notebooks and scripts.

Python package 2.13.4 downloads Hardcharger server 2.13.4 by default.

Package What it is
pip install hardcharger this package: the server
pip install adbc-driver-hardcharger the client, an ADBC/DB-API driver
pip install "hardcharger[adbc]" both, so Server.connect() returns a connection

Quick start

import hardcharger

with hardcharger.Server() as server, server.connect() as conn, conn.cursor() as cur:
    cur.execute(operation="SELECT 42 AS answer, HARDCHARGER_VERSION() AS version")
    print(cur.fetch_arrow_table())

Server() listens on a free port on 127.0.0.1, with an in-memory database and an administrator hardcharger whose password it generates (server.password). The credentials reach the server through its environment, so they don't show in ps.

Hand the server to any other client by its URI:

import hardcharger

with hardcharger.Server(database="analytics.duckdb", password="change-me") as server:
    print(server.uri)  # hardcharger://127.0.0.1:<port>?tls=false
    print(server.username, server.port, server.health_port)

TLS is tls_cert= and tls_key= (the URI drops ?tls=false, and connect() trusts that certificate); any other server option goes in extra_args=[...] or, as HARDCHARGER_* variables, in env={...}. hardcharger-server --help lists them all.

The command line

The package also installs hardcharger-server, which runs the downloaded server:

$ hardcharger-server --version
Hardcharger 2.13.4
$ python -m hardcharger download       # download (if needed) and print the binary's path
/home/me/.cache/hardcharger/v2.13.4/linux-amd64/bin/hardcharger-server

The download

Starting with 2.1.0, the hardcharger PyPI package version matches the server it downloads: hardcharger==2.1.0 uses server 2.1.0. A Python-only fix uses a post-release, such as 2.1.0.post1, and still downloads server 2.1.0. Release candidates use PEP 440 (2.1.0rc1) for Python and 2.1.0-rc.1 for the server. The separate ADBC driver has its own release cycle.

The server comes from a public source. No account, token or Docker is needed:

  1. GitHub Releases of gizmodata/hardcharger. The release tarball is fetched from its direct download URL (https://github.com/gizmodata/hardcharger/releases/download/v<version>/hardcharger-<platform>.tar.gz), which uses neither the GitHub API nor its rate limit, and its SHA-256 must match the release's SHA256SUMS.
  2. The container image ghcr.io/gizmodata/hardcharger:<version>, on Linux, when GitHub can't be reached or refuses: a sandbox that allows PyPI and ghcr.io but not github.com, for example. The launcher reads the image through the registry's HTTP API (an anonymous pull token, the manifest for this architecture), checks every layer against its digest and takes the server's files out of the layers. They are the files of the release tarball, byte for byte, and run outside the image as the tarball's do. The image holds Linux binaries, so on macOS the server comes from GitHub only.

Whatever the source, the unpacked server must report the expected version, or nothing is installed. A download that doesn't match its checksum or digest stops the install. A source that can't be reached or refuses is passed over, with a line on stderr saying why, and when every source fails the error names each one and its reason: the HTTP status, a rate limit and when it resets, the connection error, the host a redirect led to.

HARDCHARGER_INSTALL_SOURCE picks one source: github, or ghcr for the container image alone (Linux):

HARDCHARGER_INSTALL_SOURCE=ghcr python -m hardcharger download

HARDCHARGER_INSTALL_REGISTRY_IMAGE names another copy of the image, without a tag (the server version is the tag): docker.io/gizmodata/hardcharger, or a mirror in an air-gapped network such as registry.example.com/mirror/hardcharger (http:// in front for a registry without TLS). The image must be one that can be pulled without signing in.

On Linux x86_64 there are two builds. The optimized one (hardcharger-linux-amd64.tar.gz) needs an x86-64-v3 CPU (AVX2: Intel Haswell, AMD Excavator or newer). The baseline one (hardcharger-linux-amd64-baseline.tar.gz, from server 2.13.2 on) runs on any x86-64 CPU, such as a virtual machine whose CPU model is QEMU's kvm64, but slower. The launcher installs the optimized build unless this CPU lacks an instruction it needs; then it installs the baseline build and says why. HARDCHARGER_CPU_TARGET=optimized or =baseline chooses:

HARDCHARGER_CPU_TARGET=baseline python -m hardcharger download

The baseline build comes from GitHub Releases only (the container image holds the optimized build), and is cached apart from the optimized one.

A GitHub token is optional: HARDCHARGER_INSTALL_TOKEN, else GH_TOKEN, else the token of a signed-in gh (gh auth token). With one, the GitHub API is asked first, which is how a GitHub Enterprise Server or a private copy of the repository is read (HARDCHARGER_RELEASE_API_URL, HARDCHARGER_RELEASE_REPO). A token the API refuses (expired, or one for something else) is not the end: the launcher says so and downloads without it. HARDCHARGER_INSTALL_TOKEN=none never sends a token. The token is sent only to the GitHub API, never to the host a download is redirected to nor to the container registry, and is never printed.

Variable Meaning
HARDCHARGER_SERVER_BINARY run this hardcharger-server instead of downloading one
HARDCHARGER_VERSION the server version to download (default: the one this package pins)
HARDCHARGER_CACHE_DIR where downloads are kept (default ~/.cache/hardcharger)
HARDCHARGER_INSTALL_SOURCE auto (default: GitHub, then on Linux the container image), github or ghcr
HARDCHARGER_INSTALL_REGISTRY_IMAGE the container image, without a tag (default ghcr.io/gizmodata/hardcharger)
HARDCHARGER_INSTALL_TOKEN a GitHub token for the GitHub API (none: never send one)
HARDCHARGER_RELEASE_API_URL the GitHub API's base URL (default https://api.github.com), e.g. GitHub Enterprise Server
HARDCHARGER_RELEASE_DOWNLOAD_URL the base of the direct download URLs (default https://github.com); with only the API URL set, the API is used
HARDCHARGER_RELEASE_REPO the repository the releases come from (default gizmodata/hardcharger)
HARDCHARGER_CPU_TARGET Linux x86_64: auto (default: optimized, or baseline when this CPU needs it), optimized or baseline

Tests

uv venv && uv pip install -e . --group dev
.venv/bin/python -m pytest -m "not integration and not download"      # no server needed
HARDCHARGER_PY_TEST_SERVER_BINARY=/path/to/hardcharger-server \
  .venv/bin/python -m pytest -m "integration and not client"           # the real server
.venv/bin/python -m pytest -m download                                 # real downloads

The unit tests use a fake GitHub and a fake container registry on 127.0.0.1 and never the network. The client tests also need adbc-driver-hardcharger installed. The integration, client and download tests fail, never skip, without their server, client or access to GitHub and ghcr.io.

License

Apache License 2.0.

This package is Python only and contains no third-party code. The hardcharger-server it downloads does: its release archive's THIRD_PARTY_NOTICES.md and THIRD_PARTY_NOTICES-web-ui.txt, which the install keeps beside bin/ (~/.cache/hardcharger/v<version>/<platform>/), list that software and its licences, and hardcharger-server --licenses prints them.


Built by GizmoData

Metadata

Release files for hardcharger 2.13.4

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

Source distribution (sdist)

Source distribution for hardcharger 2.13.4
File Size Uploaded Provenance Actions
hardcharger-2.13.4.tar.gz 52.5 kB With provenance Details for hardcharger-2.13.4.tar.gz

Built distribution (wheel)

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

Total release size: 77.9 kB

Release files / hardcharger-2.13.4.tar.gz

Download URL hardcharger-2.13.4.tar.gz
Size 52.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e8ad0b392fcadccb437e69f00acb93dd4e6b35462464a83d259f9e938af42891
BLAKE2b-256 checksum
How to use checksums
a6912e0371f785e08f29ced707917ef776097bc7e97011fe821a9bd4e13ce791
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 21, 2026.

Transparency log

Release files / hardcharger-2.13.4-py3-none-any.whl

Download URL hardcharger-2.13.4-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03db7452d7e7f34dcb9bbb75d0e2567dcc3bebb81ad1f52142334a640e603ba7
BLAKE2b-256 checksum
How to use checksums
f425e432deff3a1e7bed193703e5430b3e7f89d45c207dcf0f1a3136dfbb963f
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 21, 2026.

Transparency log

Security for hardcharger 2.13.4

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 hardcharger-2.13.4.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 21, 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