Skip to main content

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

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.9.23
File
hdbcli-2.9.23-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
hdbcli-2.9.23-cp39-cp39-win32.whl CPython 3.9 CPython 3.9 Windows x86-32 Details
hdbcli-2.9.23-cp38-cp38m-win_amd64.whl CPython 3.8 CPython 3.8 pymalloc Windows x86-64 Details
hdbcli-2.9.23-cp38-cp38m-win32.whl CPython 3.8 CPython 3.8 pymalloc Windows x86-32 Details
hdbcli-2.9.23-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
hdbcli-2.9.23-cp38-cp38-win32.whl CPython 3.8 CPython 3.8 Windows x86-32 Details
hdbcli-2.9.23-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
hdbcli-2.9.23-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
hdbcli-2.9.23-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
hdbcli-2.9.23-cp34-cp34m-win_amd64.whl CPython 3.4 CPython 3.4 pymalloc Windows x86-64 Details
hdbcli-2.9.23-cp34-abi3-manylinux2014_ppc64le.whl CPython 3.4 abi3 Linux glibc 2.17+ PowerPC 64-le Details
hdbcli-2.9.23-cp34-abi3-manylinux1_x86_64.whl CPython 3.4 abi3 Linux glibc 2.5+ x86-64 Details
hdbcli-2.9.23-cp34-abi3-macosx_10_7_x86_64.whl CPython 3.4 abi3 macOS 10.7+ x86-64 Details
hdbcli-2.9.23-cp27-cp27mu-manylinux2014_ppc64le.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.17+ PowerPC 64-le Details
hdbcli-2.9.23-cp27-cp27mu-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64 Details
hdbcli-2.9.23-cp27-cp27mu-macosx_10_7_x86_64.whl CPython 2.7 CPython 2.7 pymalloc wide-unicode macOS 10.7+ x86-64 Details
hdbcli-2.9.23-cp27-cp27m-win_amd64.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-64 Details
hdbcli-2.9.23-cp27-cp27m-manylinux2014_ppc64le.whl CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.17+ PowerPC 64-le Details
hdbcli-2.9.23-cp27-cp27m-manylinux1_x86_64.whl CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64 Details
hdbcli-2.9.23-cp27-cp27m-macosx_10_7_x86_64.whl CPython 2.7 CPython 2.7 pymalloc macOS 10.7+ x86-64 Details

Total release size: 125.4 MB

Release files / hdbcli-2.9.23-cp39-cp39-win_amd64.whl

Download URL hdbcli-2.9.23-cp39-cp39-win_amd64.whl
Size 3.6 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
cc481b0cc0f834cb4cb90b2edd96f1f9c5ca64446b50381e54d9459e29bed9c4
BLAKE2b-256 checksum
How to use checksums
1ee5f8f73481c75bbe2e895923b8b17da6db0f4f393a02cca6865ffd593b3eee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release files / hdbcli-2.9.23-cp39-cp39-win32.whl

Download URL hdbcli-2.9.23-cp39-cp39-win32.whl
Size 3.3 MB
Tags CPython 3.9 Windows x86-32
SHA-256 checksum
How to use checksums
45475408a3474ddea4f346d26c2b4c4796299f0bef43e8c8b1daa7dacbf70b8a
BLAKE2b-256 checksum
How to use checksums
e88f35f0d3a297c0c6fd2d370f5936d22cff8e9d10f67b3a813f48e8192e3043
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release files / hdbcli-2.9.23-cp38-cp38m-win_amd64.whl

Download URL hdbcli-2.9.23-cp38-cp38m-win_amd64.whl
Size 3.6 MB
Tags CPython 3.8 CPython 3.8 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
1104ca7aa24ab350d0b87c406e5c4029cc1098c7eba5915b12b181dd3eb016fb
BLAKE2b-256 checksum
How to use checksums
25dcdc787b1b40fc58e91963c23d49227313da720a608bf29ebdbbd24dfce5df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release files / hdbcli-2.9.23-cp38-cp38m-win32.whl

Download URL hdbcli-2.9.23-cp38-cp38m-win32.whl
Size 3.3 MB
Tags CPython 3.8 CPython 3.8 pymalloc Windows x86-32
SHA-256 checksum
How to use checksums
d05fe27df87af767aa21c4803dc97a7e038990f9a58ea18204f97a0b14eb3ace
BLAKE2b-256 checksum
How to use checksums
352facd4cc01920b34c9faca82df3da0f5beb5a932e25ab2036e3dd0cfe8fa60
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release files / hdbcli-2.9.23-cp38-cp38-win_amd64.whl

Download URL hdbcli-2.9.23-cp38-cp38-win_amd64.whl
Size 3.6 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
52027cbf3b7973f53aaebe285deac04d92ac6c7122fb0d40795c33f757ea9c19
BLAKE2b-256 checksum
How to use checksums
585f5ffbd9308d383875923bba51e5820fabd69b5d642effd40a122d636c965b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release files / hdbcli-2.9.23-cp38-cp38-win32.whl

Download URL hdbcli-2.9.23-cp38-cp38-win32.whl
Size 3.3 MB
Tags CPython 3.8 Windows x86-32
SHA-256 checksum
How to use checksums
252192086cdbf7daf34e6c0e4999be21f634c85d614aaa2cc7a822efca51227c
BLAKE2b-256 checksum
How to use checksums
6ca1951fb3a405e7f58f3429e61482ba102522f0897ffef3ac3705100c7ed8ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release files / hdbcli-2.9.23-cp37-cp37m-win_amd64.whl

Download URL hdbcli-2.9.23-cp37-cp37m-win_amd64.whl
Size 3.6 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
49a9f480eaa8baa09ed72eed594e189a7e921811e53eaf3b876ee88b7bec8098
BLAKE2b-256 checksum
How to use checksums
5039df5a0742f659253daeddeaa9ebfcf4c823781f1f331cfbd697466b9df92c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release files / hdbcli-2.9.23-cp36-cp36m-win_amd64.whl

Download URL hdbcli-2.9.23-cp36-cp36m-win_amd64.whl
Size 3.6 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
35c817f20ff90173dcc71b2d0e7b7a3c036012eae9f24d6e035751e59c8cb9e1
BLAKE2b-256 checksum
How to use checksums
0cffd7462ff40e64dbf2a15c6bfd77944b4a33116f88241f18d207e657b5e5a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release files / hdbcli-2.9.23-cp35-cp35m-win_amd64.whl

Download URL hdbcli-2.9.23-cp35-cp35m-win_amd64.whl
Size 3.6 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
328b0f2e29f346336579a15134f92ef26f768270c3d66d614fc029ddda964712
BLAKE2b-256 checksum
How to use checksums
ec1d38963cbf453e45e28ff242f80152d22fbaafb68d1f360246eeba8f5e7c8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release files / hdbcli-2.9.23-cp34-cp34m-win_amd64.whl

Download URL hdbcli-2.9.23-cp34-cp34m-win_amd64.whl
Size 3.6 MB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
e80c2fdc3f1be065cb7d45d3721cb80fb1e5e7aa59ba0497db22652af00f8f3c
BLAKE2b-256 checksum
How to use checksums
480d4e3a091c93c2287138983bcc1412e3bc0e2b11b05104de316583f6495a72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

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

Download URL hdbcli-2.9.23-cp34-abi3-manylinux2014_ppc64le.whl
Size 11.4 MB
Tags CPython 3.4 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
09a3bccbdd287e07a27ed995025fe7c520d434b823ac938c8e426f07ae48494f
BLAKE2b-256 checksum
How to use checksums
c1f85e1fc801c4077b6b442607f575c7cb39db75027425f601fc6997ceab9495
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

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

Download URL hdbcli-2.9.23-cp34-abi3-manylinux1_x86_64.whl
Size 11.8 MB
Tags CPython 3.4 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
80910f7ee393d4afe2508c977a2ea46b694e429bcb9cb2769f6bbf0b9968c7f4
BLAKE2b-256 checksum
How to use checksums
b74fc3dbff99aece244fca8b0460bc277394d97a2bcb93d483a698b21faf5d5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release files / hdbcli-2.9.23-cp34-abi3-macosx_10_7_x86_64.whl

Download URL hdbcli-2.9.23-cp34-abi3-macosx_10_7_x86_64.whl
Size 5.7 MB
Tags CPython 3.4 abi3 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
93823131906c1ed2da5adcd7246a4d2c4db4c1c5f32417d83cb8a96a56b91c3f
BLAKE2b-256 checksum
How to use checksums
c8e21b0a2db8b0cc656a882e713093cd83945bab21cf59a4459a5234f9ccd2d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

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

Download URL hdbcli-2.9.23-cp27-cp27mu-manylinux2014_ppc64le.whl
Size 11.4 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
0c07507860d24c83b25977b33c86d949cc598b7ac0cbcb25fa504b4cee3a464b
BLAKE2b-256 checksum
How to use checksums
a0d2aed678913b8e3ba60d185ffff79cf6cdee4b6c4e2e70288ad5d03697a019
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

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

Download URL hdbcli-2.9.23-cp27-cp27mu-manylinux1_x86_64.whl
Size 11.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
466c2f55e32ce0ea31aadfe29275c72f4d04a633a0fc4f245e5cfbfc87593f32
BLAKE2b-256 checksum
How to use checksums
27f74314334c53b7d44f892666d75c18f4b6ea3211e1b4f7bff81e72a0b239cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

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

Download URL hdbcli-2.9.23-cp27-cp27mu-macosx_10_7_x86_64.whl
Size 5.7 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
b102abe340737f9ac730e20c8639968591854c50d7bb30e1cf23a13f52037f17
BLAKE2b-256 checksum
How to use checksums
bfe1b00b9539edfad4dcf4012eaceba300e69024a00e71f329f5e1aa2b02bb1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

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

Download URL hdbcli-2.9.23-cp27-cp27m-win_amd64.whl
Size 3.6 MB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
64ed694451fdede63940c22a010e8e0331802b3967c125b4b15e4b19dfd51e33
BLAKE2b-256 checksum
How to use checksums
1aa35c0e887fdcadfa72854216bb670e4e9fd8acc7da5a8712f0394fe1936e77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

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

Download URL hdbcli-2.9.23-cp27-cp27m-manylinux2014_ppc64le.whl
Size 11.4 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.17+ PowerPC 64-le
SHA-256 checksum
How to use checksums
19752d3b343b2f7c1aa692b55a4131405543f59a721d12ed801980a7f4ddbcd7
BLAKE2b-256 checksum
How to use checksums
fed6cf4f94a6bf339f577818900a6ed6db556279561c1f1487fab75c2c9969a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

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

Download URL hdbcli-2.9.23-cp27-cp27m-manylinux1_x86_64.whl
Size 11.8 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
92b2c4ecb386cd855e64644cb52c276f2186924ea5969007a422e087f67524aa
BLAKE2b-256 checksum
How to use checksums
a7ee8e98e5fe0d9925b8fad7ceb638ea0454000fbf45b79d1baba229f4dc90da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

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

Download URL hdbcli-2.9.23-cp27-cp27m-macosx_10_7_x86_64.whl
Size 5.7 MB
Tags CPython 2.7 CPython 2.7 pymalloc macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
1d983633d32b62db22d67698fc961ef5863a0fc59181b1cc2d2fcffc03e80822
BLAKE2b-256 checksum
How to use checksums
64da7b06e25e55c524db39bf0e52e561cd7cb116208dc586a43e44739bbaf60b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.7.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.5.3

Release history Release notifications | RSS feed

This release

2.9.23 This release

20 release files

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