databend-py
Databend Cloud Python Driver with native http interface support
Installation
pip install databend-py
Usage
Use the next code to check connection:
>>> from databend_py import Client >>> client = Client( host='tenant--warehouse.ch.datafusecloud.com', database="default", user="user", port="443", secure=True, password="password",settings={"copy_purge":True,"force":True}) >>> print(client.execute("SELECT 1"))
The [host]{.title-ref}, [user]{.title-ref}, [password]{.title-ref} info will be found in databend cloud warehouse connect page as flows:
Pure Client example:
>>> from databend_py import Client >>> >>> client = Client.from_url('http://root@localhost:8000/db?secure=False©_purge=True') >>> >>> client.execute('SHOW TABLES') [[], [('test',)]] >>> client.execute("show tables",with_column_types=True) [[('Tables_in_default', 'String')], [('test',)]] # [[(column_name, column_type)], [(data,)]] >>> client.execute('DROP TABLE IF EXISTS test') [] >>> client.execute('CREATE TABLE test (x Int32)') [] >>> client.execute( ... 'INSERT INTO test (x) VALUES', [(1,)] ... ) 1 >>> client.execute('INSERT INTO test (x) VALUES', [(200,)]) 1
More usages examples find here.
Features
- Basic SQL.
- TLS support.
- Query settings.
- Types support:
- Float32/64
- [U]Int8/16/32/64/128/256
- Date/Date32/DateTime('timezone')/DateTime64('timezone')
- String
- Array(T)
- Nullable(T)
- Bool
Compatibility
- If databend version >= v0.9.0 or later, you need to use databend-py version >= v0.3.0.
License
Databend Python Driver is distributed under the [Apache license]{.title-ref}.
Metadata
Release files for databend-py 0.6.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| databend_py-0.6.4-py3-none-any.whl | Python 3 | none | any | Details |
Release files / databend_py-0.6.4-py3-none-any.whl
| Download URL | databend_py-0.6.4-py3-none-any.whl |
|---|---|
| Size | 25.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38fc8725a42245724699a133ded467f276b5c83642ca5b6b90f5adee93665e89
|
|
BLAKE2b-256 checksum How to use checksums |
df90309bceaf3279e71270371f84e3d6fc1ff32da756c61e96e2fd760e886ade
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for databend-py 0.6.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.