Skip to main content

SAP HANA Python Client

Introduction

The Python Database API Specification v2.0 (PEP 249) defines a set of methods that provides a consistent database interface independent of the actual database being used. The Python extension module for SAP HANA implements PEP 249. Once you install the module, you can access and change the information in SAP HANA databases from Python.

In PEP 249, autocommit is turned off by default. In the SAP HANA Python driver, autocommit is turned on by default.

For information, see: PEP 249 – Python Database API Specification v2.0

Getting Started

Install via pip install hdbcli or install manually via the HANA Client Install

Quick Start

  • For HANA tenant databases, use the port number 3**NN**13 (where NN is the SAP instance number - e.g. 30013).

  • For HANA system databases in a multitenant system, the port number is 3**NN**13.

  • For HANA single-tenant databases, the port number is 3**NN**15.

from hdbcli import dbapi
conn = dbapi.connect(
    address="<hostname>",
    port=3<NN>MM,
    user="<username>",
    password="<password>"
)
cursor = conn.cursor()

Execute a single statement that does not return a result set:

cursor.execute("CREATE TABLE T1 (ID INTEGER PRIMARY KEY, C2 VARCHAR(255))")
cursor.close()

Use question mark parameter binding to insert values into the T1 table created above. The parameter values are supplied as a Python sequence and can be literal values or variable names. This example uses literal values:

sql = 'INSERT INTO T1 (ID, C2) VALUES (?, ?)'
cursor = conn.cursor()
cursor.execute(sql, (1, 'hello'))
# returns True
cursor.execute(sql, (2, 'hello again'))
# returns True
cursor.close()

Use named parameter binding to insert values into the T1 table. The values are supplied as a Python dictionary, and this example uses variable names.

sql = 'INSERT INTO T1 (ID, C2) VALUES (:id, :c2)'
cursor = conn.cursor()
id = 3
c2 = "goodbye"
cursor.execute(sql, {"id": id, "c2": c2})
# returns True
cursor.close()

Loop over the rows of the result set.

sql = 'SELECT * FROM T1'
cursor = conn.cursor()
cursor.execute(sql)
for row in cursor:
    print(row)

Help

See the SAP HANA Client Interface Programming Reference for details about developing with the SAP HANA Python Client.

Community

SAP Community provides a forum where you can ask and answer questions, and comment and vote on the questions of others and their answers.

See SAP HANA Community Questions for details.

Limitations of 32-bit Windows driver

The maximum length of a LOB column for the 32-bit Python driver on Windows is 2147483647. The maximum rowcount that can be returned for the 32-bit Python driver on Windows is 2147483647.

License

The HANA Python Client is provided via the SAP Developer License Agreement.

By using this software, you agree that the following text is incorporated into the terms of the Developer Agreement:

If you are an existing SAP customer for On Premise software, your use of this current software is also covered by the terms of your software license agreement with SAP, including the Use Rights, the current version of which can be found at: https://www.sap.com/about/agreements/product-use-and-support-terms.html?tag=agreements:product-use-support-terms/on-premise-software/software-use-rights

Release files for hdbcli 2.20.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for hdbcli 2.20.15
File Actions
hdbcli-2.20.15-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for hdbcli-2.20.15-cp38-abi3-macosx_11_0_arm64.whl
hdbcli-2.20.15-cp36-abi3-win_amd64.whl CPython 3.6 abi3 Windows x86-64 Details for hdbcli-2.20.15-cp36-abi3-win_amd64.whl
hdbcli-2.20.15-cp36-abi3-win32.whl CPython 3.6 abi3 Windows x86-32 Details for hdbcli-2.20.15-cp36-abi3-win32.whl
hdbcli-2.20.15-cp36-abi3-manylinux2014_aarch64.whl CPython 3.6 abi3 Linux glibc 2.17+ ARM64 Details for hdbcli-2.20.15-cp36-abi3-manylinux2014_aarch64.whl
hdbcli-2.20.15-cp34-abi3-manylinux2014_ppc64le.whl CPython 3.4 abi3 Linux glibc 2.17+ PowerPC 64-le Details for hdbcli-2.20.15-cp34-abi3-manylinux2014_ppc64le.whl
hdbcli-2.20.15-cp34-abi3-manylinux1_x86_64.whl CPython 3.4 abi3 Linux glibc 2.5+ x86-64 Details for hdbcli-2.20.15-cp34-abi3-manylinux1_x86_64.whl
hdbcli-2.20.15-cp34-abi3-macosx_10_11_x86_64.whl CPython 3.4 abi3 macOS 10.11+ x86-64 Details for hdbcli-2.20.15-cp34-abi3-macosx_10_11_x86_64.whl
hdbcli-2.20.15-cp27-cp27mu-manylinux2014_ppc64le.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.17+ PowerPC 64-le Details for hdbcli-2.20.15-cp27-cp27mu-manylinux2014_ppc64le.whl
hdbcli-2.20.15-cp27-cp27mu-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64 Details for hdbcli-2.20.15-cp27-cp27mu-manylinux1_x86_64.whl
hdbcli-2.20.15-cp27-cp27mu-macosx_10_7_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode macOS 10.7+ x86-64 Details for hdbcli-2.20.15-cp27-cp27mu-macosx_10_7_x86_64.whl
hdbcli-2.20.15-cp27-cp27m-win_amd64.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-64 Details for hdbcli-2.20.15-cp27-cp27m-win_amd64.whl
hdbcli-2.20.15-cp27-cp27m-manylinux2014_ppc64le.whl CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.17+ PowerPC 64-le Details for hdbcli-2.20.15-cp27-cp27m-manylinux2014_ppc64le.whl
hdbcli-2.20.15-cp27-cp27m-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64 Details for hdbcli-2.20.15-cp27-cp27m-manylinux1_x86_64.whl
hdbcli-2.20.15-cp27-cp27m-macosx_10_7_x86_64.whl CPython 2.7 CPython 2.7 pymalloc macOS 10.7+ x86-64 Details for hdbcli-2.20.15-cp27-cp27m-macosx_10_7_x86_64.whl

Total release size: 108.2 MB

Release files / hdbcli-2.20.15-cp38-abi3-macosx_11_0_arm64.whl

Download URL hdbcli-2.20.15-cp38-abi3-macosx_11_0_arm64.whl
Size 5.2 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7dd3c920c8c5bb72669cca3cc6c6d1b18df5d5ee8edc9eb95a1567f0856f998c
BLAKE2b-256 checksum
How to use checksums
504a17e2230b6fe461ecc82031bf3d5989cf044a80b144152755c72c7143dd14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp36-abi3-win_amd64.whl

Download URL hdbcli-2.20.15-cp36-abi3-win_amd64.whl
Size 3.5 MB
Tags CPython 3.6 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
69f02dae4dd079c6dd01e299acf6bda0a8a095a18ea72f6955d84fb99c9fcd4e
BLAKE2b-256 checksum
How to use checksums
f13d2d9bb61073c8e22776f06d5393ceddb5013ddb486b7806d30f7be0b74509
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp36-abi3-win32.whl

Download URL hdbcli-2.20.15-cp36-abi3-win32.whl
Size 3.5 MB
Tags CPython 3.6 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
756f0821be0baea981a0f6e74a68c345ce3eba53546cd2371b182b1d84c2f968
BLAKE2b-256 checksum
How to use checksums
caae07a2314ff9f4ab3f3056d0191aaa55f33598b06c81860807483837f5ddf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp36-abi3-manylinux2014_aarch64.whl

Download URL hdbcli-2.20.15-cp36-abi3-manylinux2014_aarch64.whl
Size 10.8 MB
Tags CPython 3.6 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
3177e62266366e12e5f7d5866b05bc97c497fbce16574fe5983cb9fd480a4de1
BLAKE2b-256 checksum
How to use checksums
30d204784eeb51698e81563b5f13e11b55413abd624ef8064aa5ea52e8a3fab0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp34-abi3-manylinux2014_ppc64le.whl

Download URL hdbcli-2.20.15-cp34-abi3-manylinux2014_ppc64le.whl
Size 10.9 MB
Tags CPython 3.4 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
3cc94e2372954aa1a3cb5db6b946fddcc6e1251bcda2696279750c7f068e4f24
BLAKE2b-256 checksum
How to use checksums
b44d269fa18817722de7e97714c64026597e07b4b01668b3f52f270c6fb477ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp34-abi3-manylinux1_x86_64.whl

Download URL hdbcli-2.20.15-cp34-abi3-manylinux1_x86_64.whl
Size 10.8 MB
Tags CPython 3.4 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
b62c5a85351b3bf62c6f65c468bca495df8a9ada1f1822ef54fc382e0270b6ca
BLAKE2b-256 checksum
How to use checksums
c17d562bab07223216027dc6dd2ae41e801fe1be56173d9ac3cce1f667a4a8d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp34-abi3-macosx_10_11_x86_64.whl

Download URL hdbcli-2.20.15-cp34-abi3-macosx_10_11_x86_64.whl
Size 5.5 MB
Tags CPython 3.4 abi3 macOS 10.11+ x86-64
SHA-256 checksum
How to use checksums
60fe7be485a6dde0bb68998aacc0961265efe4c0e1d8e10f7ea68c0522429102
BLAKE2b-256 checksum
How to use checksums
21ce52e9aeb86bde4afad96663200e07a5047e15c413c1379efb3fa051e4cb35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp27-cp27mu-manylinux2014_ppc64le.whl

Download URL hdbcli-2.20.15-cp27-cp27mu-manylinux2014_ppc64le.whl
Size 10.9 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.17+ PowerPC 64-le
SHA-256 checksum
How to use checksums
24147e184271e5fefa117686fab3e8491a9e93bfd055ba5fac0dcaa0c93adad8
BLAKE2b-256 checksum
How to use checksums
526d6fdd9dc5f9b3786da15e487e9648bc54da24ac77d19676e78cfe2e343373
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp27-cp27mu-manylinux1_x86_64.whl

Download URL hdbcli-2.20.15-cp27-cp27mu-manylinux1_x86_64.whl
Size 10.8 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
cfdeccdfa2ee275993e975dcb5919825b6467f3a72caaa9a6903ff374dd9ee9d
BLAKE2b-256 checksum
How to use checksums
77685214dafd08129102f92038a3dc520e95aaf6f4f163b9df65073ef56d7c39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp27-cp27mu-macosx_10_7_x86_64.whl

Download URL hdbcli-2.20.15-cp27-cp27mu-macosx_10_7_x86_64.whl
Size 5.5 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
74a40be3c95c1b5dc893043af4e8c6c7b42dcd87b40f763415cc2bf54676f0aa
BLAKE2b-256 checksum
How to use checksums
ab30db0cdbdaebf6a6ad85b49515ea15ca623a3eaff98fc88b3a84b42dcc839f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp27-cp27m-win_amd64.whl

Download URL hdbcli-2.20.15-cp27-cp27m-win_amd64.whl
Size 3.5 MB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
0e2209157b5cc154519d8e819eaf7f7746b57559600a623a328892b419d467a9
BLAKE2b-256 checksum
How to use checksums
f187b516cf1bb2355ce2c5e6874cfd54e8e63031358de78f8efc2cb24ce2e67a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp27-cp27m-manylinux2014_ppc64le.whl

Download URL hdbcli-2.20.15-cp27-cp27m-manylinux2014_ppc64le.whl
Size 10.9 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.17+ PowerPC 64-le
SHA-256 checksum
How to use checksums
b81db601c2e8245daa9b101dcdf2f32d333b2cb7013462d740f83518c7978fde
BLAKE2b-256 checksum
How to use checksums
4eb8947649591de4c896ab56c2d8d6300e367bf8dddd3ce6027be28c374eee63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp27-cp27m-manylinux1_x86_64.whl

Download URL hdbcli-2.20.15-cp27-cp27m-manylinux1_x86_64.whl
Size 10.8 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
4878ba4395d1e4942d9a04bbe5f3e6b7c797057b3ae628b2a96e22b58a95ad28
BLAKE2b-256 checksum
How to use checksums
fb8123adc873d26b315ecd32ade17f526fca8d4e782c912e7788d2c7ac39aaa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Release files / hdbcli-2.20.15-cp27-cp27m-macosx_10_7_x86_64.whl

Download URL hdbcli-2.20.15-cp27-cp27m-macosx_10_7_x86_64.whl
Size 5.5 MB
Tags CPython 2.7 CPython 2.7 pymalloc macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
16642512ddd15505f528cd7597a701f109b9ea0144e4afd08ba247aba50d0e9c
BLAKE2b-256 checksum
How to use checksums
35f9de84e4cac2cec096448ced25a95de7477f167953bdb2321ec42ba26f89a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

Security for hdbcli 2.20.15

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.20.15 This release

14 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page