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
File details
Details for the file databend-1.2.344-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: databend-1.2.344-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 42.3 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 779daf4768122fef5f4fb1685ea2d66484b2987d56eec90aee5c0d55daa173bc |
|
MD5 | a49fac27c85ec18572d243a2b53f7778 |
|
BLAKE2b-256 | 84405c76a3de6fbcb3ae68afe31da2b16b5988c906bab365b73827dffc91e57e |
File details
Details for the file databend-1.2.344-cp37-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: databend-1.2.344-cp37-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 36.2 MB
- Tags: CPython 3.7+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 028298869130a8d2e6cc1aca25c6282992edbfa25a87f76aa8437cf5f67de86a |
|
MD5 | 56a9dd7dfd32f6fd8562b09a17420779 |
|
BLAKE2b-256 | b6ff7d156931c9836326b52d84aa6fa539446836f10f06d0e3308ef95a1d8ff1 |