SAP HANA Python Client
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file hdbcli-2.10.13-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 274dfd6516ad175ff15fe83daddc6bf8a3315e1afb5c6f4ee28900371a17c394 |
|
MD5 | d800fb064ba4f2710a76f115ad042510 |
|
BLAKE2b-256 | 67669fd1e74cdcc2c6d9725a3a39f784f471b70a6037450766d8b3d2b2367a6a |
File details
Details for the file hdbcli-2.10.13-cp39-cp39-win32.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp39-cp39-win32.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.9, Windows x86
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7460f190fba61ffa9e685b9aaa6cecb48da09f84a0cb306069b9f26f0780570b |
|
MD5 | 9094862953a4851abfb00147a8c6dbe6 |
|
BLAKE2b-256 | 194f0ef0b746dc6e768d5305d752a2ecd0939e4bf04c92ac7d6f59d810ee9a1e |
File details
Details for the file hdbcli-2.10.13-cp38-cp38m-win_amd64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp38-cp38m-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.8m, Windows x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c01aa23e1e0e17760f8c9d5875e738ea512420e40dacf19daf1fd4a03f74bd9b |
|
MD5 | dcfa74ecf2cca1cc93b8e2513452c45e |
|
BLAKE2b-256 | 4eadccd84a30bf98c40cff5fc2c7cbab94b36760e24e0fc9a6fb535b092a8954 |
File details
Details for the file hdbcli-2.10.13-cp38-cp38m-win32.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp38-cp38m-win32.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.8m, Windows x86
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10f42c17a74e638c84fb95ebc4510f5146a745ec7b7f062a74f6de1e22148b1d |
|
MD5 | 5e3ff57affa30d87cef645f0e0cabbba |
|
BLAKE2b-256 | 74745b0c745deffdfa5e466f722718c695046bd9d384dbe12fa09afe42bc0edf |
File details
Details for the file hdbcli-2.10.13-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6082e3b7c4b6e0ff3c1e94477db0570552e4c7d489d9e812fab792db86a71d1 |
|
MD5 | 52f49c5522b22ff4134b3f707881d877 |
|
BLAKE2b-256 | be6f3223682860caf23c9b15f1786a6705d4279a7f71c601a7c5b5aba0ef1151 |
File details
Details for the file hdbcli-2.10.13-cp38-cp38-win32.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp38-cp38-win32.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.8, Windows x86
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | efc336c2ca8083d0cc8f386c2a23b6c9ed8df52c53e1dcd5131954ac0d15f45a |
|
MD5 | ad66f9a7702ecdf48eb38949b6adcbcb |
|
BLAKE2b-256 | 0c369c91e679d6962a652a5b1579ae2956a2c5af6cb08faa7df8d3a0e6d35240 |
File details
Details for the file hdbcli-2.10.13-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52dcd6888a472c218351df3e79e5af001d5cf1b9494ecdb7f818d320ed2b053e |
|
MD5 | cd79b408a2dcb2d75c51a7d633cf84dd |
|
BLAKE2b-256 | 43227eca27867a5685066cf6e19bfffec2de3e54d82c764ae561038d283aa699 |
File details
Details for the file hdbcli-2.10.13-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a403de7f88a157e0ea17980a6dd753b17acadaf1969f38bedf77b79629cd877 |
|
MD5 | 874be0ad7ea48360abf794792c770f7f |
|
BLAKE2b-256 | 72d59fe8912749940be6148ef019d0a460fd4631faa4b012b50e07affc5d564c |
File details
Details for the file hdbcli-2.10.13-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 759187ef37c5de26c037de617603208271113914bb4f344b6ed3a22300dcac68 |
|
MD5 | 27db4664213c1ef25898614bf96b26c0 |
|
BLAKE2b-256 | 9813d41a85894188fc139473563aa1fad746f624fb4532b4636d01f9695b82be |
File details
Details for the file hdbcli-2.10.13-cp34-cp34m-win_amd64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp34-cp34m-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.4m, Windows x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31775d4e4e36486d4d10ef607b5d98a99cbf7b2fcda353e2aee9425987e31556 |
|
MD5 | 57087bf48e36ee435af0b7b59c8e458b |
|
BLAKE2b-256 | 8ef2e6d6ffccd027c8602c38f477e89df5ff0e84b17d68e7d51bd0646c579f1d |
File details
Details for the file hdbcli-2.10.13-cp34-abi3-manylinux2014_ppc64le.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp34-abi3-manylinux2014_ppc64le.whl
- Upload date:
- Size: 11.4 MB
- Tags: CPython 3.4+
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04aaa2bc14b147ebf82259e38b551adfec7f17dc0acdfc9a1a4229ea6ae639cf |
|
MD5 | ec5321b209cf41ccc67ed42bf52da89c |
|
BLAKE2b-256 | bb8b2e924ebcd0afc37dff3612bf39ce7afec980c8bdd9afe12ad5c95ddc7143 |
File details
Details for the file hdbcli-2.10.13-cp34-abi3-manylinux1_x86_64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp34-abi3-manylinux1_x86_64.whl
- Upload date:
- Size: 11.7 MB
- Tags: CPython 3.4+
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43ab93e742992018e26318d8753e0455daec02fb83f6ba25215856ca2e081295 |
|
MD5 | f44c76951edec5df2f59cde677a61e36 |
|
BLAKE2b-256 | ef0d6ee27b5bb64f95ca135ede8fc5cc4b61fcf40ba9ea63a34d5e7ace39cb7a |
File details
Details for the file hdbcli-2.10.13-cp34-abi3-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp34-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 5.6 MB
- Tags: CPython 3.4+, macOS 10.7+ x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fb8bd4431f7df98f4f2ed5822e34dddac68f291c5897aacb75f38785ac2d1ef |
|
MD5 | 738251204fdd245d967b02711eb25181 |
|
BLAKE2b-256 | da8278e54c3042ffb7425efdd0148707e99707b6f3001deed7bfbd4bab11a0c7 |
File details
Details for the file hdbcli-2.10.13-cp27-cp27mu-manylinux2014_ppc64le.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp27-cp27mu-manylinux2014_ppc64le.whl
- Upload date:
- Size: 11.4 MB
- Tags: CPython 2.7mu
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4acb0257bc55854e8c4a2d2a8eb38d6241bc3c1f91d2b6251314d78acd6484af |
|
MD5 | 243832af11f16b599839067a7e24285a |
|
BLAKE2b-256 | c9cad1c51ec1374cd1becae07cc7c5c20e95e7e6cb6915f728451b3dd55f5a75 |
File details
Details for the file hdbcli-2.10.13-cp27-cp27mu-manylinux1_x86_64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp27-cp27mu-manylinux1_x86_64.whl
- Upload date:
- Size: 11.7 MB
- Tags: CPython 2.7mu
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92231948f7f51fbfae99a8312e1103b301416088fc6ef45fac23721abcec13b2 |
|
MD5 | 4743e07c9dc6712c91995aa091fb1030 |
|
BLAKE2b-256 | 012877b1170b21d7bc8701bfe21478f82b1fea0701ef0a83ce5ba7a78321abde |
File details
Details for the file hdbcli-2.10.13-cp27-cp27mu-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp27-cp27mu-macosx_10_7_x86_64.whl
- Upload date:
- Size: 5.6 MB
- Tags: CPython 2.7mu, macOS 10.7+ x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0308b0ee927804c42261ba875e4358d825e5d92e11c5a6977deaf0c87dcdf6c |
|
MD5 | 6d609b4f7075198ac60775680342f170 |
|
BLAKE2b-256 | 1225837bf92ada0c787579dfdfdb10afc265546f7bddeb298dd72498233f6f8d |
File details
Details for the file hdbcli-2.10.13-cp27-cp27m-win_amd64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp27-cp27m-win_amd64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 2.7m, Windows x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a0474fe2b63cc044af9e31f9a0a8122b8c1ab51830b5b494a725e5a3d035a21 |
|
MD5 | a2bdcd4cd04d85914544577c00b96e40 |
|
BLAKE2b-256 | f6cd58ff2fee49200093852bc900d83f686b61a60d8d1e15da994c7814d0828d |
File details
Details for the file hdbcli-2.10.13-cp27-cp27m-manylinux2014_ppc64le.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp27-cp27m-manylinux2014_ppc64le.whl
- Upload date:
- Size: 11.4 MB
- Tags: CPython 2.7m
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d759bf849e42b789d072b427b27fceb997bde245fa6c4f6d927bb5a5706408bb |
|
MD5 | 3ed7f2b8a5af8922bbe5dfcc286fdaa5 |
|
BLAKE2b-256 | 9e3cf17ff978c205993233f8e8b663f6f62385f2fb5e54f7ca8015fbfd7bde78 |
File details
Details for the file hdbcli-2.10.13-cp27-cp27m-manylinux1_x86_64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp27-cp27m-manylinux1_x86_64.whl
- Upload date:
- Size: 11.7 MB
- Tags: CPython 2.7m
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7715ece3c5cec461ca5325d07e284714b19eb63e95e6b17625c8fac28a72db21 |
|
MD5 | ad55f93ea93ea3eb00fcf945be9891a4 |
|
BLAKE2b-256 | 5f9e0236f7b509bb80dc46d50e313f31d19b63805ae341b2a9cc0baa05a7be0d |
File details
Details for the file hdbcli-2.10.13-cp27-cp27m-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: hdbcli-2.10.13-cp27-cp27m-macosx_10_7_x86_64.whl
- Upload date:
- Size: 5.6 MB
- Tags: CPython 2.7m, macOS 10.7+ x86-64
- Uploaded using 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.62.3 CPython/3.5.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48266e05d33efeede6e025dbc7a810413341c757257df38054e6152c2690a187 |
|
MD5 | c5ad66d34807ce86c94772f3af40f1e9 |
|
BLAKE2b-256 | 0827a277a839c5ffdac65e43cc18da81ed95716f00e76e0cb655bd1f15aceb9f |