Skip to main content

No project description provided

Project description

Databend Python Binding

This crate intends to build a native python binding.

Installation

pip install databend

Usage

Basic:

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
df.to_py_arrow()

# convert to pandas
df.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")

Development

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

More

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.142-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (33.8 MB view hashes)

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

databend-1.2.142-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (29.9 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

databend-1.2.142-cp37-abi3-macosx_11_0_arm64.whl (29.8 MB view hashes)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

databend-1.2.142-cp37-abi3-macosx_10_7_x86_64.whl (32.4 MB view hashes)

Uploaded CPython 3.7+ macOS 10.7+ x86-64

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