Skip to main content

High-performance Python driver for SAP HANA with native Arrow support

Project description

pyhdb-rs

PyPI Python CI License

High-performance Python driver for SAP HANA with native Apache Arrow support.

Features

  • DB-API 2.0 compliant — Drop-in replacement for existing HANA drivers
  • Zero-copy Arrow integration — Direct data transfer to Polars and pandas
  • Async support — Native async/await with connection pooling
  • Type-safe — Full type hints and strict typing
  • Fast — Built with Rust for 2x+ performance over hdbcli

Installation

pip install pyhdb_rs

With optional dependencies:

pip install pyhdb_rs[polars]    # Polars integration
pip install pyhdb_rs[pandas]    # pandas + PyArrow
pip install pyhdb_rs[async]     # Async support
pip install pyhdb_rs[all]       # All integrations

[!TIP] Use uv pip install pyhdb_rs for faster installation.

Quick start

from pyhdb_rs import connect

with connect("hdbsql://USER:PASSWORD@HOST:39017") as conn:
    cursor = conn.cursor()
    cursor.execute("SELECT * FROM MY_TABLE")
    for row in cursor:
        print(row)

Usage

Polars integration

import pyhdb_rs.polars as hdb

df = hdb.read_hana(
    "SELECT * FROM sales WHERE year = 2024",
    "hdbsql://USER:PASSWORD@HOST:39017"
)
print(df.head())

pandas integration

import pyhdb_rs.pandas as hdb

df = hdb.read_hana(
    "SELECT * FROM sales",
    "hdbsql://USER:PASSWORD@HOST:39017"
)

Async support

from pyhdb_rs.aio import connect

async with await connect("hdbsql://USER:PASSWORD@HOST:39017") as conn:
    df = await conn.execute_polars("SELECT * FROM sales")
    print(df)

[!NOTE] Use async with for proper resource cleanup. The context manager handles connection pooling automatically.

Connection pooling

from pyhdb_rs.aio import create_pool

pool = create_pool(
    "hdbsql://USER:PASSWORD@HOST:39017",
    max_size=10,
    connection_timeout=30
)

async with pool.acquire() as conn:
    df = await conn.execute_polars("SELECT * FROM sales")

Error handling

from pyhdb_rs import connect, DatabaseError, InterfaceError

try:
    with connect("hdbsql://USER:PASSWORD@HOST:39017") as conn:
        cursor = conn.cursor()
        cursor.execute("SELECT * FROM nonexistent")
except DatabaseError as e:
    print(f"Database error: {e}")
except InterfaceError as e:
    print(f"Connection error: {e}")

Type hints

This package is fully typed and includes inline type stubs:

from pyhdb_rs import connect, Connection, Cursor

def query_data(uri: str) -> list[tuple[int, str]]:
    with connect(uri) as conn:
        cursor: Cursor = conn.cursor()
        cursor.execute("SELECT id, name FROM users")
        return cursor.fetchall()

Requirements

  • Python >= 3.12

Development

git clone https://github.com/bug-ops/pyhdb-rs
cd pyhdb-rs/python

pip install -e ".[dev]"

pytest
ruff check .
mypy .

Documentation

See the main repository for full documentation.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhdb_rs-0.2.1.tar.gz (110.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyhdb_rs-0.2.1-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl (2.9 MB view details)

Uploaded PyPymusllinux: musl 1.2+ x86-64

pyhdb_rs-0.2.1-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded PyPymusllinux: musl 1.2+ ARM64

pyhdb_rs-0.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

pyhdb_rs-0.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

pyhdb_rs-0.2.1-cp313-cp313t-musllinux_1_2_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.13tmusllinux: musl 1.2+ x86-64

pyhdb_rs-0.2.1-cp313-cp313t-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.13tmusllinux: musl 1.2+ ARM64

pyhdb_rs-0.2.1-cp312-abi3-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.12+Windows x86-64

pyhdb_rs-0.2.1-cp312-abi3-musllinux_1_2_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ x86-64

pyhdb_rs-0.2.1-cp312-abi3-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

pyhdb_rs-0.2.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB view details)

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

pyhdb_rs-0.2.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.5 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

pyhdb_rs-0.2.1-cp312-abi3-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

pyhdb_rs-0.2.1-cp312-abi3-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

Details for the file pyhdb_rs-0.2.1.tar.gz.

File metadata

  • Download URL: pyhdb_rs-0.2.1.tar.gz
  • Upload date:
  • Size: 110.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyhdb_rs-0.2.1.tar.gz
Algorithm Hash digest
SHA256 57acf3a43551b86c348c2dee72561213f3c9f65c25f154a307dc50fb27622226
MD5 99891e3bec77ba3b7063a0500fda646c
BLAKE2b-256 f5585f194eef5d540b98b2ae5ffa91936cd35850f889b31342083cb9da92fb61

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1.tar.gz:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 60292f1f531330ffe322855a70d6ddb3f7f8cc558f9f313b1f04c4f2a1d4daba
MD5 ff9ebab25832817c977e37579956dbb9
BLAKE2b-256 d1984d4c061061c95022d84dc36301a17d3fc5795be7cda0b7d3731d6455b2ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 127b276421ba5564f10a6314c174e496ffb5a98557275c4de69b19c51cc0084d
MD5 39e94b3e7312218d23ba46d7c0131e28
BLAKE2b-256 7822c8646ce90621788bd72cd85ec138374ebccdd5bbee004454e9cfda162300

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 47346823777249d5602a090b2c90bd352ed9de8e3baf4578decf6c55829538ef
MD5 b8b2b28cdcfe6a94ec2a6137ea36b85a
BLAKE2b-256 2776c405ade705625363cc9f861f33912527f0c8427956aae2fb4f13cac89787

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d37ae26d8ee99a1d82dd7a97a60ce05bacf9d305e7a41c13e15698139cc10c79
MD5 02ab12ee8e0aa43abc7e70543f03bdb4
BLAKE2b-256 809ec334957fa389a75c9cb0a18af34e6fd76f92bf9cdcf9ec3bb54a9f00f18c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp313-cp313t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-cp313-cp313t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0b208f65eeecb4c70e3feb97e8a88f30b46a34e05ba35d463202b5b61ed83c65
MD5 96dd83e1062c5413fc93e52235a64e10
BLAKE2b-256 d6acac470de2cbf7179c583956dba506e9504370c12fcdd70324567b31124bdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp313-cp313t-musllinux_1_2_x86_64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp313-cp313t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-cp313-cp313t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 de35257fbb1da14b88e53a5e32f88938ded71621f801809ef3743f664b3a2488
MD5 5e89f171e54066a8342d12b34bb12d25
BLAKE2b-256 c4613844966f00e4b8641dca6b496af775400f7cfddb60e3562816604fc6cdee

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp313-cp313t-musllinux_1_2_aarch64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: pyhdb_rs-0.2.1-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyhdb_rs-0.2.1-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 42a50f08b7b0f8076f3f4ab5eb1c1efc40d0fb9aa028b42f84faa0913752c2f3
MD5 9fbdd26b372dca4a750abb444a6185a9
BLAKE2b-256 c0290593aaff0117d5cd977a72be3100774547b960d18992cca439fe924cf701

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp312-abi3-win_amd64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp312-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a5a42ed55b47935fb6f2edace7e699befa78ff91eb653ccedbefa58a2de86c0e
MD5 8bade04e5d88db49f2c13bd4d2131248
BLAKE2b-256 131f64ce76e65ea8be9082f95a18b0a1c886d71846074ebbad6ca3f14b160912

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp312-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp312-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 bc979759a2f5a8cc26015fcb22aa7c124757b4db4c51f698fe5b20665c253249
MD5 6a248913cb96ac510f91d25cfad63857
BLAKE2b-256 07f6a0506909745382f1ede1e33853430090d724b52bf0105287775b8da60e8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp312-abi3-musllinux_1_2_aarch64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 581e063b4a04bbf05682aff231a218e0b3e11bfc2c6447112ee84d9a6e6a9882
MD5 3b1569556dae9411278b99b46ad03421
BLAKE2b-256 9089419ad788e66985b34539c5edf05b2360198854a48a868622d69688e7fcf4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 27e30aab1ee180160ef5f5d7b3a8fab601da7fb1e9c6b52a3c60fecb3f9d899f
MD5 c946f3b7687845f604167e76a35586cb
BLAKE2b-256 5ae80da3c22b3aa80f3c0e8cf03e73790488a93625d91724a1d9a7996dcfa2ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bf2e2303befb3b47c2d96eb1d9f33be0992ce9055d613e7b2ae4e42288ef45bd
MD5 75c98a30afa63c706eadd8b41b37610d
BLAKE2b-256 bbe65211aa0cc73a6cc553b8fc93d993046902b930bf78a230301bd3a4dc25f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyhdb_rs-0.2.1-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.1-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 76b18a15b30455ecd4ef8f72ca14dc57811b0e6c5fb6352914f3fcefd8ada807
MD5 ff0c2e1c5f0e47e2e2b66110854f9d5d
BLAKE2b-256 63126341018b396909660969c62b17617765d4c1f531da6e6595ed5ab47c6639

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.1-cp312-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on bug-ops/pyhdb-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page