Skip to main content

Databend Python Binding

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


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.453-cp37-abi3-manylinux_2_28_x86_64.whl (52.0 MB view details)

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

databend-1.2.453-cp37-abi3-macosx_11_0_arm64.whl (45.0 MB view details)

Uploaded CPython 3.7+ macOS 11.0+ ARM64

File details

Details for the file databend-1.2.453-cp37-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for databend-1.2.453-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 26eeb5b5a61a4143e66b783a0d56b03f2d0a5b70800b657d0a752906ae1e755f
MD5 3b74e45c824b86a87e6303725b6ffd38
BLAKE2b-256 f5703e7d72c75fefd304ac6d7d7933a4de1bc7f6b99185dd741de04878a07756

See more details on using hashes here.

File details

Details for the file databend-1.2.453-cp37-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for databend-1.2.453-cp37-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 161d1ce8d2ae0e8923994c154dc84e7a225a09656ca6caabaeae61df847933a8
MD5 b55dda2ef1643ae2f8425a020cf4d461
BLAKE2b-256 1f2799464be8dd23a5911c2e96ccb4df9b8fcf09384cf7465143d4b2b8c156da

See more details on using hashes here.

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