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.

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

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

Total release size: 106.5 MB

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

Download URL hdbcli-2.4.191-cp38-cp38m-win_amd64.whl
Size 3.3 MB
Tags CPython 3.8 CPython 3.8 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
17de556f667c81ebf4e870c4d7f0c3dd6456544b90dfd616f6c1eef65d7f7498
BLAKE2b-256 checksum
How to use checksums
61abb0da0e59ef76d091086e7e0fb4ec243c7e5f6df8f283102a524ba8b66a6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp38-cp38-win_amd64.whl
Size 3.3 MB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
25c3579b95c9b1c19c4b8fe2a2f7a3a6d2792eb169d5ba68a9954bc96066035f
BLAKE2b-256 checksum
How to use checksums
59e7b53694cd6970a05ae65f9b67cf39fcaf6d516ae00bb4c0bb78ff913864ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp37-cp37m-win_amd64.whl
Size 3.3 MB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
3ea4532757cb09c04047117904521f5d21fa651898c95af7e0ffb3a9146bdfd8
BLAKE2b-256 checksum
How to use checksums
d8b55d60428f30f1e9b4940ac99f62325f465fbb4e4a861dcbe0ecef85fd12e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp36-cp36m-win_amd64.whl
Size 3.3 MB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
3bab28fa98167c56daaef198480ee737718f222bca454077fc0f490271b1b2cb
BLAKE2b-256 checksum
How to use checksums
34c3ed2abe1e816174972d82ec704ace33d6562e71040c9e7bb4ea630ef6c731
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp35-cp35m-win_amd64.whl
Size 3.3 MB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
f7c16f0779f1be2e9e4a62417092953bda7ad68235147c140c92722f11e73eed
BLAKE2b-256 checksum
How to use checksums
8951c7e5fc6f3b51e0d9cd70008f2c645a97372541cc340b593530b7abbf62a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp34-cp34m-win_amd64.whl
Size 3.3 MB
Tags CPython 3.4 CPython 3.4 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
78c4e4859e8a7af7d6881e276c766adda65d92f1b87e9c54f78804332b9f98eb
BLAKE2b-256 checksum
How to use checksums
d630e8eaee0793992d8e517b3ea42fb3c966328e300332f87a1c1609c2fe0611
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp34-abi3-manylinux1_x86_64.whl
Size 22.4 MB
Tags CPython 3.4 Linux glibc 2.5+ x86-64 abi3
SHA-256 checksum
How to use checksums
98720129dc2b6f0e145ddbe30f6acceed9658d1420d10fe9bbd91239643fec19
BLAKE2b-256 checksum
How to use checksums
ebd4cc0576835a6c84f5c5fec6a6051233f52c20b231f3fecd795c20c8715a43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp34-abi3-macosx_10_7_x86_64.whl
Size 5.3 MB
Tags CPython 3.4 abi3 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
aa8018ff4000bf56af564cdc49747c81f5ab2dff490c126f4eb1096181babe71
BLAKE2b-256 checksum
How to use checksums
a9e3a8acb9adc00b3a44df0f8e65e962671ee167d391991e7601d2d9feeb9b8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp27-cp27mu-manylinux1_x86_64.whl
Size 22.5 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
9a764231ff7b6584a5c1ceb22cd093c1dfc02250d2261ddfce5822701c8ead73
BLAKE2b-256 checksum
How to use checksums
a69d97238829528b6687f4f00dc2c79256cc8fb88dc9347b0a161f8e606ad102
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp27-cp27mu-macosx_10_7_x86_64.whl
Size 5.3 MB
Tags CPython 2.7 CPython 2.7 pymalloc wide-unicode macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
3758f8d403baa61ddb888e5563cdb0a4ae72c0dd0b6ae6969f09fd4f1f62a62e
BLAKE2b-256 checksum
How to use checksums
d0b28b50ad2223abdeabe630de14734ad16330e42021b4b57d638f8eceecb2d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp27-cp27m-win_amd64.whl
Size 3.3 MB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
63008b9bd8001e145794ccbb2a831acafc6ce2a326483447e7c86bb25e854735
BLAKE2b-256 checksum
How to use checksums
c4d72f94de0465f7574c6f53ee911feb255f1c823e28cfbf9ec7de1dc6a4f50f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp27-cp27m-manylinux1_x86_64.whl
Size 22.5 MB
Tags CPython 2.7 CPython 2.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
e2a421db058be81eff135593be1f3bae9583055d49d3ec690297f8ac1972d9ea
BLAKE2b-256 checksum
How to use checksums
fa25003804ffaf1b76b0fd831ca64c6a0fa453edcadd1c160492c1c0f9e139a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

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

Download URL hdbcli-2.4.191-cp27-cp27m-macosx_10_7_x86_64.whl
Size 5.3 MB
Tags CPython 2.7 CPython 2.7 pymalloc macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
51fd11d92adfa979ed18d764fa39d8d519692521ebb72f4cb7048fc65dcedc7b
BLAKE2b-256 checksum
How to use checksums
2eebc0cbc6eed0825a5b4359baa9518b80b434bcb9e89c5ced67dc8f9f264db9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

Release history Release notifications | RSS feed

This release

2.4.191 This release

13 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