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

Uploaded PyPymusllinux: musl 1.2+ x86-64

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

Uploaded PyPymusllinux: musl 1.2+ ARM64

pyhdb_rs-0.2.0-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.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

pyhdb_rs-0.2.0-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.2.0-cp313-cp313t-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.13tmusllinux: musl 1.2+ ARM64

pyhdb_rs-0.2.0-cp312-abi3-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.12+Windows x86-64

pyhdb_rs-0.2.0-cp312-abi3-musllinux_1_2_x86_64.whl (2.8 MB view details)

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

pyhdb_rs-0.2.0-cp312-abi3-musllinux_1_2_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ ARM64

pyhdb_rs-0.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

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

pyhdb_rs-0.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

pyhdb_rs-0.2.0-cp312-abi3-macosx_11_0_arm64.whl (2.2 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

pyhdb_rs-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: pyhdb_rs-0.2.0.tar.gz
  • Upload date:
  • Size: 109.7 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.0.tar.gz
Algorithm Hash digest
SHA256 0153674470551982483f3b5fd04fb944081a8afe998cfa5e5285adc35f4ab06c
MD5 b96e024186c0110301f74f204511e756
BLAKE2b-256 3c868184bbebefd6a119ba30080ea78a31d402387b9bf68ca47a82a2b6d47d61

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3905dbdf53c580d0d2f1a94e7771abb69577b2985f15633633189c6da9cacb53
MD5 f6777f4678f89796ebb525972dd14dcf
BLAKE2b-256 829b1f1f3a476e6c30f9298b69c45eb4918927662a63c3108af4ea6887dcf789

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 f7306c86a4d0685e1dd2383b2d0f1095c5ee96d4c670d517c10d8454130c6fb4
MD5 6d28f773bc1c966c6ec89da753c1306a
BLAKE2b-256 27838eae3df2dbbd0a7909bda2f0064b42c01f9814f6057117fbefdbb8ca155e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1bd2cdbc546e626d72bc237cf0072a91b95c83d5f819c5cc40ad74251c304a2f
MD5 bcea0cd7e93721fdf0f504f5ba03555d
BLAKE2b-256 fcd72caab22c7bcc86637883fccc4677dfcb145ce9c7047d07ce0f85c07c3785

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 47c36ccdf97dee8a2680fc98dffc75f4b6cd3f3e6d2b0838eeb751d70d270b5f
MD5 d2788e795ee71403a69a9f836067c387
BLAKE2b-256 2766e75a635bbf8f6158f0d5e1867e50fdf096c3749f01899d866dbb555c96f3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-cp313-cp313t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7f80157855ad274e0e6612cd12c5e75ee421d3121024193914cbe4d28a36a0f1
MD5 f408b4275fd7235e34e35553d0385d07
BLAKE2b-256 3ac1c3d37e38a7e728da1945eb7fb6a3919f0beebf3345df879a097f0ed0f789

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-cp313-cp313t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 72c37fb554acd20b1b745491f30f59f9d48d976b205dcf913a3d459e3764063c
MD5 fe6efd5ce10d4ae6c04c6a8c552da22a
BLAKE2b-256 e4122088608c41ef9cb626e11aec8d41d86a3f302a599e1e787deab400b56a95

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyhdb_rs-0.2.0-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.3 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.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 187665184e42781a6727124846f9bdb6c397fd60c5dbf11ae75d1b2c87c34f6f
MD5 c981679d76289399c6bac4a91c87f634
BLAKE2b-256 32c5256fb926074615c222941b168da1de3929e0e314023e929110f3999ef46c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 762298aad8f29e2b62917adfb2534e14f1196e16b9a9ecf2c8c64097e816c8aa
MD5 1ddc1f1ef1bed4b61b89591fba033e8b
BLAKE2b-256 f3a888966959e111fa6d53205c096c12c16f0713cf3eacb056144bfa388ed696

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-cp312-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0bb2cfee82e34864d6abdce21df4e4ec60f982aa7201370197ab13302c3b8617
MD5 43fc864851deacdeb8fd1f29e5138396
BLAKE2b-256 924aa052140fa270990f2d9f74e89aec5f4cab8df012655ca43657a882a4485f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca618ae1d3c2c0a8fc5b1ff96c43b4f14038a4bd4048c85ec400d57fe7644cb2
MD5 a78eec0a6e17c1a8991b1967bd3f1be9
BLAKE2b-256 98614ec272b9e261e84c718b1c7feb840a869983fa1acdbbf9021e25375ce8db

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b62c5e7b67f3c92fcd831603291707a3cbee56ed33847b97904b2fddfd16e57e
MD5 68eb6ada327d0aa71e66243c47d3e10d
BLAKE2b-256 99873702358bbf516562323c36024c291dd9a8070d1e877dc1e126e99b17551d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d00b7598e6225f9bf278c2ffda5a37cdce348f23abb7fd09ba0bcbc31d9a3e3d
MD5 4ff1e227b56707b6011420ece441b60a
BLAKE2b-256 a98803dec7038ac0188eda0c5a1132e572f9cf7de7ef37eb2c9c83ccc45861bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyhdb_rs-0.2.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fc4e6937b5ab99f58c81e650c5b0aa3ba729f2bd17fa3ae20a0be1604ca3a508
MD5 abf1982f632a6465c6ca13fed82af920
BLAKE2b-256 d7620d221f0357a5ede72daeadefd90d4feef4b604618b02b9224be23e68f490

See more details on using hashes here.

Provenance

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