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.11

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.1.3.tar.gz (108.2 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.1.3-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded PyPymusllinux: musl 1.2+ x86-64

pyhdb_rs-0.1.3-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded PyPymusllinux: musl 1.2+ ARM64

pyhdb_rs-0.1.3-cp314-cp314t-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

pyhdb_rs-0.1.3-cp314-cp314t-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

pyhdb_rs-0.1.3-cp313-cp313t-musllinux_1_2_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.13tmusllinux: musl 1.2+ x86-64

pyhdb_rs-0.1.3-cp313-cp313t-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.13tmusllinux: musl 1.2+ ARM64

pyhdb_rs-0.1.3-cp311-abi3-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.11+Windows x86-64

pyhdb_rs-0.1.3-cp311-abi3-musllinux_1_2_x86_64.whl (2.8 MB view details)

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

pyhdb_rs-0.1.3-cp311-abi3-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

pyhdb_rs-0.1.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

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

pyhdb_rs-0.1.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

pyhdb_rs-0.1.3-cp311-abi3-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

pyhdb_rs-0.1.3-cp311-abi3-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: pyhdb_rs-0.1.3.tar.gz
  • Upload date:
  • Size: 108.2 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.1.3.tar.gz
Algorithm Hash digest
SHA256 a7c5e54f3e3c7c48c2ad6f3fd9b89003f6d3a9af7aa808b1c0da15b62fe39b05
MD5 25fc71c32cdb566aaa220a49fbf7b75e
BLAKE2b-256 2d8ab44eca378ff493c8cd7016790b760a93f0affbdbd9b242b594b11b314847

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d2497f85f9bf289f1acfd4e98aa3500535c4696b5b43c91a924f611e09b08b99
MD5 8bf9b55ae63cc8a028df88c639b54436
BLAKE2b-256 50f1327ec4b3f068f5d23ff98b83d91ca3a3ebc2c99ac14713c2647734a339ec

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 059b8d7ea277a06fc2af89abe2b7e7a35c984a93a99f8ba54423094f137d40ed
MD5 9c7370ded804fd4ceae4a5080dbc2dcf
BLAKE2b-256 fc9c58af1cbba7064f82e7bbb7668becc7df44f6ce6a2e13913cf4f5e38345b5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cd4c2c603eb750d96aaa83585452c85202b7168df318e0ca8ee1a4e985947715
MD5 203c3ab0996efc1acf695ab9ea4c6fad
BLAKE2b-256 573cb9841373985df297f1ff1b23d39aa8b01994a5e99c8748e83d8ea4aa7e2e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4a5ea05a1de9ce7ab7c7f0fd0216a8f2a337fbc25c3aaa6fc5b2ba5139675332
MD5 11af1e9fbb309b0708c2ab527833e559
BLAKE2b-256 e7eb55ea1a02e7ee96e62d3f43c1fde9187f8240095bcca1444b1dc0037f59fe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-cp313-cp313t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3af9a3b20a390440e50694dc0e7dc81f5cafa9228b88199da118f976bc776f8b
MD5 af4b5d24f380cf4f5197d705155f4a6d
BLAKE2b-256 efaa1e0ea6c472b47f67453a7e441378450719f777404a60da4c2fa2d7745d82

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-cp313-cp313t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 6c1217f1f59da16ea86deda19e56802e50ffec851bae27e0d67fee800ab2df72
MD5 601f1d16b3fb505ecdff87dc0ded8aa0
BLAKE2b-256 8c6c561d9459c900cd122e9c10e7885f80e30e451517e58923e3286770cdd122

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.1.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.1.3-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: pyhdb_rs-0.1.3-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.11+, 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.1.3-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9f57457101b08067278591b00321c64bd20e8b764bdb8ac18970a5e587a19086
MD5 bcb055654f16b0e33b227cc8099fef81
BLAKE2b-256 129eb4d45ee4b7aa488e1084764c13d0ee9b3c2a3117f540a7f3508e5906fe09

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.1.3-cp311-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.1.3-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 59e9c8477b5de108c62eb6d6642969e9611fe557ed0b22188b16ab06386d80dd
MD5 87d98552431e4bdbe4306fda278bbcde
BLAKE2b-256 0fc97c77f6bfce3b12441547fbba92536ee8b83fcb658fc605f8d41ab6822bd2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.1.3-cp311-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.1.3-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5bb148bc59f7646e78dc0c007b1aaa367310a466c828458f89bea448a82167a8
MD5 ad67904e060357507e29581e89016ed1
BLAKE2b-256 bfa36b2b70530febd7e4b11e473604f8a51ebfb309ebd8b7e6ac189be6135c19

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.1.3-cp311-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.1.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc5566a888a163ec40d957b64689fb738487b7b607ce599772337ea15ec93ccb
MD5 ccc0267ca67940969fa4f2d8facbfb3c
BLAKE2b-256 f14b154bba57dd934e527539c6938575dae40a83c410d4e7983153bf74a3e26a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.1.3-cp311-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.1.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fb8dc89a56210071abead206bc826fc69ebffb486f46bced4e62cf7b9ad94cf1
MD5 0c3324f7e16685e0fa16c0d93b014228
BLAKE2b-256 699c539aeb2400188e04bf83ac62491ba66b88e9fc4b0a65d004894cffb6e1a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.1.3-cp311-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.1.3-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be1b146f2abb8fbb6907754b105bcaf7d8f98246379623921f949ba688119f9f
MD5 572dc66def1fd4dd0be1af450f9b9994
BLAKE2b-256 9a15ba5ac52ffd5388cbe90cb20b87ef6c5f59f8e50d17fc3759bd7b154f74bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyhdb_rs-0.1.3-cp311-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.1.3-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyhdb_rs-0.1.3-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 35e80975706c21ef54ce3a6e876f746ca190c545f4815384602b16d10c331288
MD5 06fbfbc719ccac99d9c3dce9bcfe2e5d
BLAKE2b-256 7f9085d9faf6ab1379981bd00b6cb7f05ab9b63f447d79aa6864e433eab7a90f

See more details on using hashes here.

Provenance

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