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.4.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.4.0
File Size Uploaded Provenance Actions
arrowbricks-6.4.0.tar.gz 264.9 kB With provenance Details for arrowbricks-6.4.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for arrowbricks 6.4.0
File Actions
arrowbricks-6.4.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for arrowbricks-6.4.0-cp311-abi3-win_amd64.whl
arrowbricks-6.4.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.4.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
arrowbricks-6.4.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for arrowbricks-6.4.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
arrowbricks-6.4.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for arrowbricks-6.4.0-cp311-abi3-macosx_11_0_arm64.whl
arrowbricks-6.4.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for arrowbricks-6.4.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 13.0 MB

Release files / arrowbricks-6.4.0.tar.gz

Download URL arrowbricks-6.4.0.tar.gz
Size 264.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5fe0e1beb980127edfeab48b96a4c49123bbcc492f6a68b75ba4bf9d6f9a812a
BLAKE2b-256 checksum
How to use checksums
2268e0e97aadd3083722a1ae176d53e93547d75e15d6b6296b9b1729ff14b617
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 19, 2026.

Transparency log

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

Download URL arrowbricks-6.4.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
41756604f2c694dd31d3a1fe4b9ce312ef1f57032df63248b140067326af692c
BLAKE2b-256 checksum
How to use checksums
d19acf0994ab3d0a686089b39852798abba7958f825eef25d5c63db0caa036d4
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 19, 2026.

Transparency log

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

Download URL arrowbricks-6.4.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
116fd4d8d555770b5780f3a3deb77eca928dfca342a7e4b728ccaf2b32a4ea32
BLAKE2b-256 checksum
How to use checksums
325778ddcbd0f9d886c5340bc7df20fbecf76b180091990298a1d6f540795d65
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 19, 2026.

Transparency log

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

Download URL arrowbricks-6.4.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
2572ce0c93612be381795c618b09976c0bf9986762815f6ec1a547cea210de14
BLAKE2b-256 checksum
How to use checksums
16d635601384737a8ec428ced2dc4a82ceb0ccd72965d4532a2d159005d71283
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 19, 2026.

Transparency log

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

Download URL arrowbricks-6.4.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
91857129d6658516df56f71b395711cfd331d1624ec7b4aaa8126979ad7b0aaf
BLAKE2b-256 checksum
How to use checksums
82b94e8f371f5047d25145ae1e9995717145a0098ed92d02d3e878241dca473e
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 19, 2026.

Transparency log

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

Download URL arrowbricks-6.4.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
5d1750488feb8cd983ee974ac15cb28a5c65e1b2c845b7ac81c5b9161b736a89
BLAKE2b-256 checksum
How to use checksums
fd8094f3fcd45cc85d0ad84a4b2c629e3baa1e51d46adcba36268211f48798fc
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 19, 2026.

Transparency log

Security for arrowbricks 6.4.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.4.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 19, 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.4.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