Skip to main content

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hdbcli-2.18.24-cp38-abi3-macosx_11_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

hdbcli-2.18.24-cp36-abi3-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.6+Windows x86-64

hdbcli-2.18.24-cp36-abi3-win32.whl (3.1 MB view details)

Uploaded CPython 3.6+Windows x86

hdbcli-2.18.24-cp36-abi3-manylinux2014_aarch64.whl (10.7 MB view details)

Uploaded CPython 3.6+

hdbcli-2.18.24-cp34-abi3-manylinux2014_ppc64le.whl (10.8 MB view details)

Uploaded CPython 3.4+

hdbcli-2.18.24-cp34-abi3-manylinux1_x86_64.whl (10.7 MB view details)

Uploaded CPython 3.4+

hdbcli-2.18.24-cp34-abi3-macosx_10_11_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.4+macOS 10.11+ x86-64

hdbcli-2.18.24-cp27-cp27mu-manylinux2014_ppc64le.whl (10.8 MB view details)

Uploaded CPython 2.7mu

hdbcli-2.18.24-cp27-cp27mu-manylinux1_x86_64.whl (10.7 MB view details)

Uploaded CPython 2.7mu

hdbcli-2.18.24-cp27-cp27mu-macosx_10_7_x86_64.whl (5.6 MB view details)

Uploaded CPython 2.7mumacOS 10.7+ x86-64

hdbcli-2.18.24-cp27-cp27m-win_amd64.whl (3.5 MB view details)

Uploaded CPython 2.7mWindows x86-64

hdbcli-2.18.24-cp27-cp27m-manylinux2014_ppc64le.whl (10.8 MB view details)

Uploaded CPython 2.7m

hdbcli-2.18.24-cp27-cp27m-manylinux1_x86_64.whl (10.7 MB view details)

Uploaded CPython 2.7m

hdbcli-2.18.24-cp27-cp27m-macosx_10_7_x86_64.whl (5.6 MB view details)

Uploaded CPython 2.7mmacOS 10.7+ x86-64

File details

Details for the file hdbcli-2.18.24-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp38-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 5.2 MB
  • Tags: CPython 3.8+, macOS 11.0+ ARM64
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b2dfbbec1bd87dcf9ea0786b38d2baffc4f077d1276e734b38281613b45dda73
MD5 19ef18076cd1b3a8ba7f33adf54da683
BLAKE2b-256 b6711cec766c644f61559167be70429d12b6ad5e68bf9feb692b7802bcda5403

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp36-abi3-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp36-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.6+, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp36-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ffa420b3e867f8dcf1e4e2b20fee57ebda257b01ec5775484b5bbb88d29256c9
MD5 b52feeab4a450071ce320b588bf5bedf
BLAKE2b-256 8d8d9e62762819cb07b31ca7c3fc7192f6e32e394ca177bc2872e3ff1f9bdd11

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp36-abi3-win32.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp36-abi3-win32.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: CPython 3.6+, Windows x86
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp36-abi3-win32.whl
Algorithm Hash digest
SHA256 2cd1d064e06af8f5604ae36293141865ea90f19e8e3ba6bf1e35382bb09f25cd
MD5 d5558f53f35cec6e09d8ba7450c985c0
BLAKE2b-256 150502e5dc079da5a0643c9f744a3c51ab3b226607dd29f549464532551b376b

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp36-abi3-manylinux2014_aarch64.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp36-abi3-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 10.7 MB
  • Tags: CPython 3.6+
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp36-abi3-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 855bb0515e9967b883464061f8d23910b75385d96661f3f0f5a8b05bdb93ab49
MD5 92d69280733175ddaf366e949c7385a0
BLAKE2b-256 5c044f6e4a8a97a5597c9e46edd2d7df23a0099e35c97830972e5a1e01ce572b

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp34-abi3-manylinux2014_ppc64le.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp34-abi3-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.8 MB
  • Tags: CPython 3.4+
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 1164ac83f94c4e75e7467809d847d9b6fedd9ef1c6cb0ca3284bf355a6a59a78
MD5 f85c4fb7c6598a7d31d4938f8d0b343e
BLAKE2b-256 365898a4ab205eea637d6dfb65c5ddfcfb992ec6a93d5cb4287882a9dd2247de

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp34-abi3-manylinux1_x86_64.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp34-abi3-manylinux1_x86_64.whl
  • Upload date:
  • Size: 10.7 MB
  • Tags: CPython 3.4+
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0464aae677201511d75c48d7bc81a153490d1e24091c1f9e206494a29c471a27
MD5 8c0b6dc3dfdea0efb597d6f13a80e604
BLAKE2b-256 b34c1ad36b87b88afbe0b4bea85c6878fd4c2a91733fc866e6405f65ee2f93c1

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp34-abi3-macosx_10_11_x86_64.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp34-abi3-macosx_10_11_x86_64.whl
  • Upload date:
  • Size: 5.6 MB
  • Tags: CPython 3.4+, macOS 10.11+ x86-64
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp34-abi3-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 5baf2fd11f213558f328a6f9d1fd2fa5a95aa84238865ef4e61d880e6cc40cef
MD5 6b2635caf20e779e56db7b3e03e4d96e
BLAKE2b-256 9bf84e15296b09b68a890408a342931b77d9a370057a39d1cda881e1d2c2b8b7

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp27-cp27mu-manylinux2014_ppc64le.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp27-cp27mu-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.8 MB
  • Tags: CPython 2.7mu
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 9649fe6b07ff64808ccfd4ff93672ee4b9b73dfe2cd923b63e6de1501986bac7
MD5 958f83b86ba6ea2c3d6738a222dbd9a9
BLAKE2b-256 a1ca57550d870c1230a327c63e9eaec000f507a6f8b70263d2a87c22dceed054

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 10.7 MB
  • Tags: CPython 2.7mu
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3369661b1108ec7fc34881496a5e1d1fcf13ab53a721372d82bc5fc0b8e25f1b
MD5 18acab9cd4c1dda28e2ca7518e221cf1
BLAKE2b-256 1c76d3b524028e4ff32c668eb8a1af3a1e0679805364301cc5217eba0a6e3e9b

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp27-cp27mu-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: hdbcli-2.18.24-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.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.18.24-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 130c6b416217b9a1e7005c29f1dd4ab69853a252b50ad452fa00207055331778
MD5 8906bcfdd3ee82d65ee14952948113e1
BLAKE2b-256 c5145556555651c8fe912eaeb9585296ff3bf71677d9f6ddf7e2197f1dcb4ec3

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 3ade3ff3bf17f8aa0d4f80499f6f8c4e60f5382e108f98290a85397778720093
MD5 d364d855a46b6f4cb519e02b0676e167
BLAKE2b-256 85c8502f702cb000d12dc760a9f61a2a6dea1d5bab1a7003a684c5bb3dd63e55

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp27-cp27m-manylinux2014_ppc64le.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp27-cp27m-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.8 MB
  • Tags: CPython 2.7m
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 cb6e11494155647619a176a79ccd82581ebc7303960aefab3a811807e1f95d45
MD5 a1eb6f0939e3762245c082b62bd36ec0
BLAKE2b-256 3b88ad8ca1e0c86a110c77efd556919b9ecb2790cceddc873fc3c34586dab734

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: hdbcli-2.18.24-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 10.7 MB
  • Tags: CPython 2.7m
  • Uploaded using 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

File hashes

Hashes for hdbcli-2.18.24-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 03b669e42bc8aa8e698adf214d3e7328a37d1839519145df061f35ae5c49d14c
MD5 221d1942cae6134adcd4c1ec647d08ce
BLAKE2b-256 847ea0330b5949d19252cd0594ba89a0952c2949b3e27533e5c34400fd040a64

See more details on using hashes here.

File details

Details for the file hdbcli-2.18.24-cp27-cp27m-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: hdbcli-2.18.24-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.8.2 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/1.0.0 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.18.24-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 3dfa671d8e8c6eedc136c98bf35fddb98b5239a803a7baa874c701d83060b20c
MD5 23016eccbb15cb9d0fddda72a95ea468
BLAKE2b-256 edaa499bccc74bb0ded5eca61db8c6c6630d8f43cea9c01da6cd3c5376fdcf03

See more details on using hashes here.

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