Skip to main content

Hardcharger™

CI PyPI version Python 3.10 or later PyPI downloads Hardcharger Python client documentation ADBC 1.12 ADBC conformance suite passing Follows the ADBC driver style guide Chargewire protocol Go core Python bindings Hardcharger Apache 2.0 license GizmoData™

Query Hardcharger from Python, C/C++, Go, R, Rust or any ADBC language.


🔌 What is it?

The Python ADBC driver for Hardcharger™, GizmoData™'s DuckDB 2.0 server: a DB-API 2.0 connect() with Arrow results, bind parameters, bulk ingest, cancel, and Hardcharger's tags, settings, browser sign-in (SSO), client certificate sign-in and connection profiles. The wheel carries the native driver library (Go, built on the Chargewire ADBC driver), so there is nothing else to install.

This page is about Python. C/C++, Go, R, Rust and the other ADBC languages, installing the driver library without Python, and the full option reference are in the repository README.

📥 Install

pip install adbc-driver-hardcharger

Python 3.10 or newer, with pyarrow 16.0.0+ and adbc-driver-manager 1.8.0+ (pip installs both; connection profiles need adbc-driver-manager 1.11.0+). Wheels for Linux (amd64, arm64; glibc 2.17 or newer), macOS 13 or newer (arm64, amd64) and Windows (amd64). pip install hardcharger is the Hardcharger server, started from Python; pip install "hardcharger[adbc]" installs both.

🚀 Quick start

from adbc_driver_hardcharger import dbapi as hardcharger

with hardcharger.connect(
    uri="hardcharger://localhost?tls=false", username="hardcharger", password="change-me"
) as conn:
    with conn.cursor() as cur:
        cur.execute(operation="SELECT 42 AS answer, ? AS greeting", parameters=["hello"])
        print(cur.fetch_arrow_table())

The connection and cursor are DB-API 2.0 objects with ADBC's extensions: fetch_arrow_table(), fetchall(), adbc_ingest() for bulk loads, adbc_get_objects() and the rest. Errors are the DB-API exceptions (an SQL error is a ProgrammingError).

catalog= and db_schema= make a catalog and a schema current when connecting. db_schema is one schema name in catalog (in the server's default catalog without it) and is never split at a dot, because a dot can be part of a schema's name: for the schema reports of the catalog lake, pass catalog="lake", db_schema="reports". On an open connection, set conn.adbc_current_catalog first, then conn.adbc_current_db_schema: setting the catalog moves to that catalog's default schema, as SQL USE does.

🔗 URIs

URI Meaning
hardcharger://host HTTPS to host:31337
hardcharger://cluster.gizmodata.com HTTPS to port 443: a GizmoData Cloud host (gizmodata.com or any name under it) defaults to 443
hardcharger://host:port HTTPS to another port (an explicit port always wins)
hardcharger://host?tls=false Plain HTTP (development, loopback)
profile://name An ADBC connection profile (see Connection profiles below)

TLS is on unless the URI says ?tls=false, and the driver never falls back to plain HTTP.

⚙️ connect() arguments

Argument Meaning
uri, profile Where to connect: a URI, or a connection profile's name or path
username, password Password sign-in
auth_type "password" (default), "external" (browser sign-in), "client_certificate" (also "mtls")
access_token, subject_token A Hardcharger access token, or your identity provider's token to exchange for one
oauth_timeout, open_browser, share_sign_in Browser sign-in: how long to wait (default 300 s), how to open the page, one sign-in for many connections
tls_root_certs, tls_client_cert, tls_client_key PEM text or file paths: a private CA to trust, a client certificate and its key
tls_server_name, tls_skip_verify The TLS server name when it isn't the URI's host; no certificate check (development only)
session_tag, query_tag JSON objects (a dict) recorded in Hardcharger's instrumentation
settings hardcharger.* session settings, e.g. {"query_timeout": 60}
catalog, db_schema The current catalog and schema
session_id, close_session_on_release Attach to an existing session; keep a session when closing
resume_timeout Seconds to wait for a stopped GizmoData Cloud cluster that is starting again (default 600)
autocommit Default True
db_kwargs, conn_kwargs Any other ADBC option (hardcharger.*; the names from before 2.7.0 still work, with a deprecation warning), listed in the repository README

help(adbc_driver_hardcharger.dbapi.connect) describes each one.

🎛️ Tags and settings

with hardcharger.connect(
    uri="hardcharger://localhost?tls=false",
    username="hardcharger",
    password="change-me",
    session_tag={"app": "nightly-etl"},
    query_tag={"job": "load-orders"},
    settings={"query_timeout": 60},
) as conn:
    conn.set_query_tag(tag={"job": "refresh-rollups"})  # every later statement
    conn.set_setting(name="query_timeout", value=120)  # SET SESSION hardcharger.query_timeout
    print(conn.get_setting(name="query_timeout"))  # '120'
    conn.reset_setting(name="query_timeout")
    conn.set_setting(name="max_concurrent_statements", value=8, scope="global")  # admins only
    conn.reset_setting(name="max_concurrent_statements", scope="global")
    print(conn.current_user(), conn.server_version())
    print(conn.settings())  # hardcharger_settings(), as Arrow

Tags are stored in _hardcharger_instr.sql_statements.query_tag and _hardcharger_instr.sessions.session_tag when the server runs with --enable-instrumentation. Settings and tags apply to every session the connection opens, including one that replaces a session the server lost.

🔒 Read-only connections

Ask the server to enforce read-only before anything runs on the connection (Hardcharger 2.13.0 or newer):

from adbc_driver_hardcharger import dbapi as hardcharger

with hardcharger.connect(
    uri="hardcharger://localhost?tls=false",
    username="hardcharger",
    password="change-me",
    read_only=True,
) as conn:
    with conn.cursor() as cur:
        cur.execute(operation="SELECT 42 AS answer")
        print(cur.fetchone())  # (42,)

read_only=True sets the ADBC specification's standard option adbc.connection.readonly (standard options keep the adbc. prefix; this driver's own are hardcharger.*), which is how other languages ask for it and what conn_kwargs can still carry.

The restriction is one-way; open a separate connection to write. A server that rejects or ignores the option is an error, with no writable fallback.

🌐 Browser sign-in (SSO)

When the server offers browser sign-in (it was started with --oauth-client-id and --oauth-client-secret), sign in as yourself:

with hardcharger.connect(uri="hardcharger://db.example.com", auth_type="external") as conn:
    print(conn.current_user())  # the e-mail address you signed in with

The driver opens the identity provider's page in your browser, waits, and receives the server's own access token; nothing else is configured on the client. open_browser=False prints the URL instead, for a remote shell; a string is the command to open it with.

Each connect() signs in on its own, so a program that opens several connections (dbt, a pool, a notebook) would open a browser window for each. share_sign_in=True shares one sign-in among the process's connections to the same server:

for model in ("orders", "customers", "rollups"):
    with hardcharger.connect(
        uri="hardcharger://db.example.com", auth_type="external", share_sign_in=True
    ) as conn:  # one browser sign-in for all three
        ...

The token lives only in the process's memory. To sign in as two people (or roles) to one server in one process, give each its own key: share_sign_in="alice".

🪪 Client certificate sign-in (mutual TLS)

On a server that lets client certificates sign in (--mtls-ca-cert with --mtls-certificate-sign-in), the certificate is the credential:

with hardcharger.connect(
    uri="hardcharger://db.example.com",
    auth_type="client_certificate",
    tls_client_cert="client.pem",
    tls_client_key="client-key.pem",
    tls_root_certs="server-ca.pem",
) as conn:  # when the server's CA is private
    print(conn.current_user())  # the certificate's identity, e.g. ops@example.com

🎫 Token exchange (your identity provider's tokens)

A program that already holds a token from your identity provider (an OpenID Connect ID token or another JWT the server trusts: --token-jwks-uri, with its issuer and audience) signs in with it directly, with no password and no browser:

with hardcharger.connect(uri="hardcharger://db.example.com", subject_token=id_token) as conn:
    print(conn.current_user())  # the token's e-mail address

The driver exchanges it for a Hardcharger access token, and again shortly before that expires, while your provider's token is still valid.

🏷️ TLS server name

When the URI's host isn't the name on the server's certificate (an IP address, a tunnel, a port forward), give the name with tls_server_name=; the driver sends it as the TLS server name (SNI) and checks the certificate against it:

with hardcharger.connect(
    uri="hardcharger://10.0.0.7",
    username="hardcharger",
    password="change-me",
    tls_server_name="db.example.com",
    tls_root_certs="server-ca.pem",
) as conn:  # when the server's CA is private
    print(conn.current_user())

🗂️ Connection profiles

ADBC connection profiles keep a reusable connection in a TOML file (adbc-driver-manager 1.11.0 or newer). Install the driver manifest once, so the driver manager finds driver = "hardcharger":

python -m adbc_driver_hardcharger.manifest

Save hardcharger_prod.toml in your profile directory (~/.config/adbc/profiles/ on Linux, ~/Library/Application Support/ADBC/Profiles/ on macOS, %LOCALAPPDATA%\ADBC\Profiles\ on Windows, or a directory in ADBC_PROFILE_PATH):

profile_version = 1
driver = "hardcharger"

[Options]
uri = "hardcharger://db.example.com:31337"
username = "{{ env_var(HARDCHARGER_USERNAME) }}"
password = "{{ env_var(HARDCHARGER_PASSWORD) }}"

Set those environment variables, then:

from adbc_driver_hardcharger import dbapi as hardcharger

with hardcharger.connect(profile="hardcharger_prod") as conn, conn.cursor() as cur:
    cur.execute(operation="SELECT 42 AS answer")
    print(cur.fetch_arrow_table())

# Equivalent forms:
# hardcharger.connect(uri="profile://hardcharger_prod")
# hardcharger.connect(profile="/absolute/path/hardcharger_prod.toml")

Arguments given to connect() override the profile's [Options]. The same profile works through adbc_driver_manager.dbapi.connect(profile="hardcharger_prod"), without importing this package.

🔁 Attaching to an existing session

A session (its open transaction, temporary tables and settings) can outlive its connection and be picked up by another process. The first connection keeps its session when it closes and passes on its id and access token; the second attaches with both:

# Process 1: begin a transaction, then hand the session on.
with hardcharger.connect(
    uri="hardcharger://db.example.com",
    username="hardcharger",
    password="change-me",
    close_session_on_release=False,
) as conn:
    with conn.cursor() as cur:
        cur.execute(operation="BEGIN TRANSACTION")
        cur.execute(operation="INSERT INTO orders VALUES (1, 'pending')")
    session_id, token = conn.session_id, conn.access_token  # pass both on; the token is a secret

# Process 2: attach, see the uncommitted row, commit.
with hardcharger.connect(
    uri="hardcharger://db.example.com", access_token=token, session_id=session_id
) as conn:
    with conn.cursor() as cur:
        cur.execute(operation="SELECT count(*) FROM orders")
        print(cur.fetchone())  # (1,)
        cur.execute(operation="COMMIT")

An id the server doesn't have, or another user's session, fails with session_not_found. A session lives on the server replica that created it, so behind a load balancer both clients must reach that replica.

🔑 Reading the access token

with hardcharger.connect(
    uri="hardcharger://db.example.com", username="hardcharger", password="change-me"
) as conn:
    token = conn.access_token  # a bearer secret: never log it
    print(conn.access_token_expires_at)  # e.g. 2026-10-20 16:14:13+00:00 (None when unknown)

The token is renewed first when it is about to expire, so you get a current one. Whoever holds it acts as the user until it expires: keep it in memory, send it only over TLS, and never log it.

🧩 Driver manifest (other ADBC languages on this machine)

The wheel's library also serves every other ADBC driver manager on the machine (C/C++, R, Rust, Go) once a manifest names it:

python -m adbc_driver_hardcharger.manifest          # for this user, pointing at the wheel's library
python -m adbc_driver_hardcharger.manifest --print  # or print it

--dir DIR installs it into another directory. Without Python, see the repository README for installing the driver library and its manifest.

📄 License

Apache License 2.0; see LICENSE. The driver library links the Go runtime and the Go modules listed, with their licenses, in THIRD_PARTY_NOTICES, which ships in every wheel.


GizmoData™
Built by GizmoData™

Hardcharger™ and GizmoData™ are trademarks of GizmoData LLC.

Metadata

Release files for adbc-driver-hardcharger 2.7.1

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 adbc-driver-hardcharger 2.7.1
File Actions
adbc_driver_hardcharger-2.7.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for adbc_driver_hardcharger-2.7.1-py3-none-win_amd64.whl
adbc_driver_hardcharger-2.7.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for adbc_driver_hardcharger-2.7.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
adbc_driver_hardcharger-2.7.1-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl Python 3 none Linux glibc 2.5+ x86-64 Details for adbc_driver_hardcharger-2.7.1-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl
adbc_driver_hardcharger-2.7.1-py3-none-macosx_13_0_x86_64.whl Python 3 none macOS 13.0+ x86-64 Details for adbc_driver_hardcharger-2.7.1-py3-none-macosx_13_0_x86_64.whl
adbc_driver_hardcharger-2.7.1-py3-none-macosx_13_0_arm64.whl Python 3 none macOS 13.0+ ARM64 Details for adbc_driver_hardcharger-2.7.1-py3-none-macosx_13_0_arm64.whl

Total release size: 57.4 MB

Release files / adbc_driver_hardcharger-2.7.1-py3-none-win_amd64.whl

Download URL adbc_driver_hardcharger-2.7.1-py3-none-win_amd64.whl
Size 11.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
3552c95705502de5c430ecfe7d7ee61c05a4d9a53a011908dfffb2411474afdc
BLAKE2b-256 checksum
How to use checksums
b2006943b43867666417e71d8661c6cd8e6aa5a069f043b06db2b9a03f6ffca4
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 20, 2026.

Transparency log

Release files / adbc_driver_hardcharger-2.7.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL adbc_driver_hardcharger-2.7.1-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 11.2 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
034e8c21b2207f84d234488559208490771a6aeb727bfffd0940a1f3d6ae2114
BLAKE2b-256 checksum
How to use checksums
6fec4955e35e5439c04f9cc5638233ff6a8f972155b885a1edfb24d190d0b638
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 20, 2026.

Transparency log

Release files / adbc_driver_hardcharger-2.7.1-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl

Download URL adbc_driver_hardcharger-2.7.1-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl
Size 12.6 MB
Tags Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
372a620c39df6ad1177352640836be1c20a4405d211210d357438e3b4bc35aa9
BLAKE2b-256 checksum
How to use checksums
0a2e1286b2f5002a75f48ac77af82d3f5cf6c5197c32d6602b803f2c042db4f5
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 20, 2026.

Transparency log

Release files / adbc_driver_hardcharger-2.7.1-py3-none-macosx_13_0_x86_64.whl

Download URL adbc_driver_hardcharger-2.7.1-py3-none-macosx_13_0_x86_64.whl
Size 11.6 MB
Tags Python 3 macOS 13.0+ x86-64
SHA-256 checksum
How to use checksums
bee3a3f1866f135a725c47cf8f06809d086bd0e136cc11e34a377dc9ca15555f
BLAKE2b-256 checksum
How to use checksums
ff1fc1806ad1b1f307fe450811bd086b7cca49a37dd7abfdaf3c58cdc66f9269
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 20, 2026.

Transparency log

Release files / adbc_driver_hardcharger-2.7.1-py3-none-macosx_13_0_arm64.whl

Download URL adbc_driver_hardcharger-2.7.1-py3-none-macosx_13_0_arm64.whl
Size 10.2 MB
Tags Python 3 macOS 13.0+ ARM64
SHA-256 checksum
How to use checksums
626a98126270ac711b7fbd770b96149098127b14ab463897ab2aa5f06b8a73a5
BLAKE2b-256 checksum
How to use checksums
e870fc21aad8a75c3123ef013a6c7294b735101adfa42519258ba0be637a8f15
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 20, 2026.

Transparency log

Security for adbc-driver-hardcharger 2.7.1

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 adbc_driver_hardcharger-2.7.1-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 Nov 20, 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