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.453-cp37-abi3-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: databend-1.2.453-cp37-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 52.0 MB
- Tags: CPython 3.7+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26eeb5b5a61a4143e66b783a0d56b03f2d0a5b70800b657d0a752906ae1e755f |
|
MD5 | 3b74e45c824b86a87e6303725b6ffd38 |
|
BLAKE2b-256 | f5703e7d72c75fefd304ac6d7d7933a4de1bc7f6b99185dd741de04878a07756 |
File details
Details for the file databend-1.2.453-cp37-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: databend-1.2.453-cp37-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 45.0 MB
- Tags: CPython 3.7+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 161d1ce8d2ae0e8923994c154dc84e7a225a09656ca6caabaeae61df847933a8 |
|
MD5 | b55dda2ef1643ae2f8425a020cf4d461 |
|
BLAKE2b-256 | 1f2799464be8dd23a5911c2e96ccb4df9b8fcf09384cf7465143d4b2b8c156da |