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.3.tar.gz (110.8 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.3-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.3-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded PyPymusllinux: musl 1.2+ ARM64

pyhdb_rs-0.2.3-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.3-cp314-cp314t-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

pyhdb_rs-0.2.3-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.3-cp313-cp313t-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded CPython 3.13tmusllinux: musl 1.2+ ARM64

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

Uploaded CPython 3.12+Windows x86-64

pyhdb_rs-0.2.3-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.3-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.3-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.3-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.3-cp312-abi3-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

pyhdb_rs-0.2.3-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.3.tar.gz.

File metadata

  • Download URL: pyhdb_rs-0.2.3.tar.gz
  • Upload date:
  • Size: 110.8 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.3.tar.gz
Algorithm Hash digest
SHA256 65ed8d09f813ae1cb0e40b5a0d36b3aac9bc01c212720de805c38c772a8d902d
MD5 e2243cd0b92dcae0b4bd2965f1a7a05a
BLAKE2b-256 4d3c4e39866311d652038a82c7a470843863185d9d1b4deedae10ce89d314add

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3.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.3-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9465a9acc2dbf38ee965731cadecb91f8d405761e64a23e4dc6b916e124ff3c4
MD5 ae3c15545edd4beaf482f72a961dd490
BLAKE2b-256 9bd1153dd734dc3f27ba4db504576eed26d8643badbe1ba236b4cf33ad585b69

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d706deb499791e9a78e7b568d2dd7f07946a235d4bc2b37dd7692e4128415f1a
MD5 ee809725a0f28b14e8864d60616c288f
BLAKE2b-256 22c5cbf8c81e345b0f8ebc6b0964a7f2b271196b476b98281b5dedf14c3e20d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 edbd58d087f0cb5d3152865a4fe7ce368e7337e3b8214726a0b16ced9291a401
MD5 4ed1666894cbde37900b186bff90827f
BLAKE2b-256 6509bd33f6f048da0c8198718e055ff9fe397230fd5f7b1dbbd96f112cc1cae9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp314-cp314t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2c0f5c9cbabef63aee61cf5adfdc919c13cb24e421bedefaa272c6a3ef39531c
MD5 5e91eb6f6dcf1501e5f9f9b5affe91de
BLAKE2b-256 03b45a48baf28b05a4b9af089cbc4bcf4dfe8ce0f4e6bf12710700c4e6120230

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp313-cp313t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-cp313-cp313t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0eeef81779a451b4ede38fca083e4f7fcf2552b8ee71948643ba66773337a24e
MD5 05c372687443b31e1c63e0af6f800211
BLAKE2b-256 a3ada1244efc1465a1a4acd31909905116cffd63b4ecfa2d82f79c5173eda853

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp313-cp313t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-cp313-cp313t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 14cc9d9bac63ae12a83c24709f76ee143deee39f129e9333d7d3fcb05d200630
MD5 dec3a9d9191fd891e1139589de93708b
BLAKE2b-256 1038864c8519d1307f1571e61a3f9a50310fb1ff778268e7d163bfd5b87dd521

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: pyhdb_rs-0.2.3-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.3-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f9e2387308fac418e07eddf927b37496e5d4c8285a42b12508af11b3413e25d2
MD5 a5047108d674873b891c27d80c9fb56a
BLAKE2b-256 d982fa4193cfe8b79fd84fbd9ab9c90bb96d16fa78f0ddee91b2691c5bd9370e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp312-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d23a05d7668164b5b72387bf93c7b8b34805167068ae7788123a4a58773599bd
MD5 4de85d527a7a54f2bf928d8e05588177
BLAKE2b-256 327e90e62f1dd96bd51bd3b54ee021e484eb77af261abf56d8a59d8491b02962

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp312-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e148ad3c0475aa4dccad1d68d7a4518de0cbdbf2a824bfb03c0d95ebfd9307a7
MD5 c9717fbd6574f8fe5b5c4193c042e678
BLAKE2b-256 ee4f43edd20ba725b21503a35b9754230cfe52b1ef597433559a4c1b450c8bce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 027e38242eef103370ed9e3def6b751be36d9bf4bb35181aa40667f2c0bdf59c
MD5 d44155f8b04dbd7437890f905786819c
BLAKE2b-256 caff0fecc08ada212f38b24a99f28795ca0e1164f236ed456489b5f521ed5a73

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 642c2890f34d0076120224be25476ddd0aa2dc39f7fac8939057fe1c5cec78b4
MD5 c3bfe78df195994f6de748cdb46425f8
BLAKE2b-256 666888c327f1e9a3adec43317fe20873ff790aa4181a873d64f8423c626131e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e792c338f415f57f4fcbbff0e5e0e290a32be18df6a1cc3d878ddd655f4fe49
MD5 2bc32440bbc6c1b248ed77ca12d35816
BLAKE2b-256 e2e018adae340056594f7d642599f0e7e223e71993240f64574466e768320852

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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.3-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.2.3-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5465af2b65eb1e28baeefbebe27941d546ed076a10ab9c3f716531442025845e
MD5 05db231ecffc9e431fbabe7693994909
BLAKE2b-256 9fb1d026dadf195914fddcde0e77cba9c17410d361b25dabd3c37e497593e5df

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.2.3-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