Skip to main content

Databend Python Binding

Project description

Databend Python Binding

This crate intends to build a native python binding.


pip install databend



from databend import SessionContext

ctx = SessionContext()

df = ctx.sql("select number, number + 1, number::String as number_p_1 from numbers(8)")

# convert to pyarrow

# convert to pandas

Register external table:

supported functions:

  • register_parquet
  • register_ndjson
  • register_csv
  • register_tsv
ctx.register_parquet("pa", "/home/sundy/dataset/hits_p/", pattern = ".*.parquet")
ctx.sql("select * from pa limit 10").collect()

Tenant separation:

ctx = SessionContext(tenant = "a")


Setup virtualenv:

python -m venv .venv

Activate venv:

source .venv/bin/activate

Install maturin:

pip install "maturin[patchelf]"

Build bindings:

maturin develop

Run tests:

maturin develop -E test

Build API docs:

maturin develop -E docs
pdoc databend

Storage configuration

  • Meta Storage directory(Catalogs, Databases, Tables, Partitions, etc.): ./.databend/_meta
  • Data Storage directory: ./.databend/_data
  • Cache Storage directory: ./.databend/_cache
  • Logs directory: ./.databend/logs


Databend python api is inspired by arrow-datafusion-python, thanks for their great work.

Project details

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

databend-1.2.344-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (42.3 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

databend-1.2.344-cp37-abi3-macosx_11_0_arm64.whl (36.2 MB view hashes)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page