Skip to main content

arrowbricks

Fast Databricks SQL for Python applications and AI agents.

  • Zero required Python dependencies. One precompiled wheel. No Rust toolchain or cloud SDK needed.
  • Fast Rust core. Concurrent chunk downloads, lazy Arrow decoding, and streaming NDJSON without materializing the full result, with result order preserved.
  • Agent mode, new in 6.0. A CLI and Python API that return compact typed TSV (or a Markdown table), explicit truncation, and actionable JSON errors. Formatting stays in Rust.

Use Thrift by default or the Statement Execution API with protocol="sea". Bring a token or your own token-refresh callable.

Install

pip install arrowbricks

Wheels cover Linux, macOS, and Windows; Python 3.11+. Arrow, NDJSON, and agent mode work without extras. Python row tuples need pip install 'arrowbricks[arro3]'; sqlglot expressions as SQL need [sqlglot]. On Python 3.14+ pass values as a t-string (t"... WHERE id = {x}") and they are bound as parameters -- see SQL safety.

Query from an agent or terminal

export DATABRICKS_HOST='your-workspace.azuredatabricks.net'
export DATABRICKS_WAREHOUSE_ID='your-warehouse-id'
export DATABRICKS_TOKEN='your-access-token'

arrowbricks -c 'SELECT 1 AS answer'
answer:Int32
1

rows_shown=1; complete=true; total_rows=1

Output is tab-separated by default (cheapest to read; tabs, newlines and backslashes in values are escaped, NULL is \N). --format markdown / output_format="markdown" gives a pipe table instead.

Agent mode is the CLI default. SQL files and piped stdin work too:

arrowbricks --file query.sql --max-rows 20 --max-bytes 4000
printf 'SELECT 1 AS answer' | arrowbricks

Previews have row, byte, cell, and deadline limits. The footer tells you when results are incomplete. Query errors go to stderr as JSON, preserving the warehouse's diagnostic and suggestions with a recovery hint; the CLI exits 1. Preview limits bound output and fetching, not warehouse scan cost.

For Python agents:

from arrowbricks import DatabricksClient

async with DatabricksClient(host=..., warehouse_id=..., token=...) as client:
    text = await client.query_agent("SELECT 1 AS answer", max_bytes=4000)
    print(text)  # TSV on success; JSON on query failure

Give your agent the reusable Arrowbricks skill. See CLI options and skill installation and agent budgets, completeness, and cancellation.

Query from an application

The async cursor offers familiar execute and fetch* methods. Arrow results work directly with DuckDB, PyArrow, and Polars:

from arrowbricks import connect

async with connect(host=..., warehouse_id=..., token=...) as conn:
    cursor = conn.cursor()
    await cursor.execute("SELECT * FROM my_catalog.my_schema.my_table LIMIT 100")
    table = await cursor.fetchall_arrow()

Or consume ready-to-send NDJSON without building Python rows:

from arrowbricks import HEARTBEAT, DatabricksClient

async with DatabricksClient(host=..., warehouse_id=..., token=...) as client:
    async for item in client.stream_query_json("SELECT * FROM range(100)"):
        if item is not HEARTBEAT:
            print(item)

Performance

The query and formatting work runs in Rust. Agent previews render directly from Arrow, avoiding intermediate Python rows or JSON. In a real warehouse test, a 100-row preview used 44% fewer bytes and 24% fewer tokens than NDJSON. See agent measurements and methodology and client benchmarks for workloads, comparisons, and limits.

Performance tips

Numbers are measurements from one ~30 MB/s link to one warehouse, not guarantees.

  • Select only the columns you need. Selecting 3 columns instead of SELECT * was 1.5-6x faster and moved 1.9-15.8x fewer bytes across 5 tables.
  • Keep compress_results at its default (True) unless the link is very fast. Here it was 1.8-4.7x faster with 2-5.5x fewer bytes. Turning it off on a very fast link was not tested.
  • Keep the Thrift default for small lookups. It was about 0.15 s faster per tiny statement than protocol="sea" (a constant gap in these runs).

Learn more

License

MIT

Metadata

Release files for arrowbricks 6.5.0

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

Source distribution (sdist)

Source distribution for arrowbricks 6.5.0
File Size Uploaded Provenance Actions
arrowbricks-6.5.0.tar.gz 266.2 kB With provenance Details for arrowbricks-6.5.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for arrowbricks 6.5.0
File Actions
arrowbricks-6.5.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for arrowbricks-6.5.0-cp311-abi3-win_amd64.whl
arrowbricks-6.5.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for arrowbricks-6.5.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
arrowbricks-6.5.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for arrowbricks-6.5.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
arrowbricks-6.5.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for arrowbricks-6.5.0-cp311-abi3-macosx_11_0_arm64.whl
arrowbricks-6.5.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for arrowbricks-6.5.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 13.0 MB

Release files / arrowbricks-6.5.0.tar.gz

Download URL arrowbricks-6.5.0.tar.gz
Size 266.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a7f38bf7d0e0effb619b7f94440d68c277c6efec9da211bb7cc0ad664e0e7005
BLAKE2b-256 checksum
How to use checksums
13166c7871c9bb52e0ceb3d4bef8f0693976036d02d1ad1b7c47bcebd0fa87aa
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 30, 2026.

Transparency log

Release files / arrowbricks-6.5.0-cp311-abi3-win_amd64.whl

Download URL arrowbricks-6.5.0-cp311-abi3-win_amd64.whl
Size 2.7 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
795773cb3ad1d7b1474e3a4a7cb58396390fabadd88a074ed349fddf55d826d2
BLAKE2b-256 checksum
How to use checksums
24c552dc02a7e13966a95eaa808a84698624df168f051dcd5caa353d6c4d5ac5
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 30, 2026.

Transparency log

Release files / arrowbricks-6.5.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL arrowbricks-6.5.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.6 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a9495314edb9585b44e75e4ca455688b43b689b923cdf6e60c288292932a64b8
BLAKE2b-256 checksum
How to use checksums
895effadd7b1f3d202e88d8321f4b69fdaff5ebd8c22c043e0ff920ad4e7c287
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 30, 2026.

Transparency log

Release files / arrowbricks-6.5.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL arrowbricks-6.5.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 2.5 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
fcc3439662fb3b4ea0c29de95da7b5768e4df61e9383d1a86ce2429cf2fbe0bf
BLAKE2b-256 checksum
How to use checksums
853113f232c2bf9ef9770fd71c2d539f5b2e89997521b4b7d5bdc3421c4057a4
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 30, 2026.

Transparency log

Release files / arrowbricks-6.5.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL arrowbricks-6.5.0-cp311-abi3-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6cf9b072de00a36cb3e2c31efdf80e17f8edd9b21b1046ce90a6951f5bafd858
BLAKE2b-256 checksum
How to use checksums
7259d2c94a16af392f8483149452daa8c482be68a6b01c2b720116b6cd4cb17c
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 30, 2026.

Transparency log

Release files / arrowbricks-6.5.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL arrowbricks-6.5.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 2.5 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
e108b4e8add21ab76dd202d6e83090d23ccd985f51377375385c04e35750cb91
BLAKE2b-256 checksum
How to use checksums
36b65dc049d38f5eaf13e0d1e52c37a65f7c90076fda1007d0b2e5be455b6505
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 30, 2026.

Transparency log

Security for arrowbricks 6.5.0

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 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for arrowbricks-6.5.0.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 30, 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.

Release history Release notifications | RSS feed

This release

6.5.0 This release

6 release files Full provenance

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