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.27-cp38-abi3-macosx_11_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

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

Uploaded CPython 3.6+Windows x86-64

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

Uploaded CPython 3.6+Windows x86

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

Uploaded CPython 3.6+

hdbcli-2.18.27-cp34-abi3-manylinux2014_ppc64le.whl (10.9 MB view details)

Uploaded CPython 3.4+

hdbcli-2.18.27-cp34-abi3-manylinux1_x86_64.whl (10.8 MB view details)

Uploaded CPython 3.4+

hdbcli-2.18.27-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.27-cp27-cp27mu-manylinux2014_ppc64le.whl (10.9 MB view details)

Uploaded CPython 2.7mu

hdbcli-2.18.27-cp27-cp27mu-manylinux1_x86_64.whl (10.8 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mumacOS 10.7+ x86-64

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

Uploaded CPython 2.7mWindows x86-64

hdbcli-2.18.27-cp27-cp27m-manylinux2014_ppc64le.whl (10.9 MB view details)

Uploaded CPython 2.7m

hdbcli-2.18.27-cp27-cp27m-manylinux1_x86_64.whl (10.8 MB view details)

Uploaded CPython 2.7m

hdbcli-2.18.27-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.27-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: hdbcli-2.18.27-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.27-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f2acbd777386d9a19a895d69ed80a955e7d0b12757920941590f3fa08d1da033
MD5 4c61783c6c40e5a3a552efdc883bd8c2
BLAKE2b-256 81bcf13afc7e89eb43aa963469c93899e8e3fbb7dc26a8f5f4dff786cfa804d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-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.27-cp36-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 cadc728ba6f60916f68bca2d3666ab5a690b1d9a74038c6c8083794b8d23456e
MD5 fbb4dec2e2ce832239684fc0f5eeddb6
BLAKE2b-256 9abf1d507fd5b938355a2e089632be8146fe2cc8880dd9d515150e6ab3665892

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-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.27-cp36-abi3-win32.whl
Algorithm Hash digest
SHA256 96e267f4cc72ce4255ae48a71fdad0fa9cbf4a2e4305fedb1ac5387edb0db375
MD5 6de627c503a0340095e6742e994686e7
BLAKE2b-256 cfd2360f4c8c4ae88fab98016c7fa2d8b7c8038ad87d6cd2cf84eecfe2427473

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-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.27-cp36-abi3-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dcb25401af435ef537b78196887f2ee116975e32b72d3edfe52d2f2cb4632446
MD5 c9349af2ac5623f32a05db1967ae0754
BLAKE2b-256 621e3030653085fd6f63fdeb448594f7887bb8248dd40e6de8a6c65816a3cbdc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-cp34-abi3-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.9 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.27-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 880d34cf97047506eaba20835bd449b42722b1b647d79e614aec2e7f534815d9
MD5 8a56a09c437d898ca7d84b84bb06f775
BLAKE2b-256 3a02e6c6c92fa461c3c9c3b1540e1841f28d62bdef5746fb70baedc0d2e8b294

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-cp34-abi3-manylinux1_x86_64.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.27-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bfb97ff186f2eef6dd85773d3dc49df790b81c90a80a6812b74e9ef79576bfb7
MD5 f21ea47fef17166c8aa69967905325df
BLAKE2b-256 a95d36ebea2125fd2dbdb8feed0a2059b4ec73ca27e1e63d4d3c3b0623571820

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-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.27-cp34-abi3-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 899b08bd05a7541db80d08c85a81e6de2bdf03f3e3568c161da88ad942b55578
MD5 5089d7ffe5bbf475c8742f9820d14bea
BLAKE2b-256 29d7bb6b83cfb8fdb2c8c57c0b8d826448a56a2ff27e198aa724dbc89ab0fc98

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-cp27-cp27mu-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.9 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.27-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 e78336f8063f4954a82669789e943ed5df16b09326eca7f7055e40bf19a1d782
MD5 58fda3e746039875fdb090adf59c3f21
BLAKE2b-256 2d8d1b5b681e3e63fba485dc3bea861dcf67302380eecc8001f10a0a46fbde13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-cp27-cp27mu-manylinux1_x86_64.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.27-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 051b8a22f452e088faa372081361d4863c2500466724b273747a9fadd8f01884
MD5 3f55fabe39ddc9d64f33ac1e7de57e15
BLAKE2b-256 a1e2b246439485a677f0176d245cfd8a7dde5420b1db67c1ed5c63e69eae7a02

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-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.27-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 db1e615ac5d6050eff8b57ff0803a4b1e783d352eccefabae028a1b6caa4352e
MD5 cf4edc733d42931228b29149f847c70e
BLAKE2b-256 146d1a0f154832b4aad731adb974b2176692f7b7ea3d82e432ca988b799dc094

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-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.27-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 170becfa60bb84a1c7b76710908f6dfb784c0e814a939e9ccf2585947627d423
MD5 a444cea8a0de670edfcb26842227e55e
BLAKE2b-256 48a01b1284a6b198a54c9aed9aec460114937873899ef96782f7ceeae33abd92

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-cp27-cp27m-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.9 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.27-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 4d2cfb471f1d189ec26e71e4bb44a9549113da6cb8a04ebe0c3ce6dea2fbce7d
MD5 5f6d16b28b6f12d15e25d7642dc4d999
BLAKE2b-256 55df0c68285f68998b6c9868e5bfff7d2da0e41a47eefc89cdfb46260300c170

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-cp27-cp27m-manylinux1_x86_64.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.27-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3fd7e0aca8f83368303cf4e0363d420248964de94091ecc1f043c992ee3077b8
MD5 fa0e41887e2aa653d152a23e47f897d1
BLAKE2b-256 ab7745a270a2279af91b85d8eca68146030427ff5f0e8e89ef5465107f952d59

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.18.27-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.27-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f632f267003fd350862eb1cc8e491f6a725a76ee236dd5edaa567ab8b450a1d7
MD5 f1ef247346acb0490d47efa1f5ce1ea0
BLAKE2b-256 aa3a26698469ca2beb8a15ff4c502b771ad4688ede2e5f7d0e5a99de0db911c1

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