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

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

Uploaded CPython 3.8+macOS 11.0+ ARM64

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

Uploaded CPython 3.6+Windows x86-64

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

Uploaded CPython 3.6+Windows x86

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

Uploaded CPython 3.6+

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

Uploaded CPython 3.4+

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

Uploaded CPython 3.4+

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

Uploaded CPython 3.4+macOS 10.11+ x86-64

hdbcli-2.16.21-cp27-cp27mu-manylinux2014_ppc64le.whl (10.9 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mumacOS 10.7+ x86-64

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m

hdbcli-2.16.21-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.16.21-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8619719975e8f78ca514129319844a94913c28b45b72c2e0bd0df352d0b9528a
MD5 94a9ddaed9b88ac8847f369dafe0a75b
BLAKE2b-256 bd449982f11ff99468fcb349677b39d0da9e70e1f12117fdacd1c48123ffd13c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp36-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bbb464686026e984f60735b0f2b0c4b2b8157ddcef59c065c4a7e6cfabbcd6d6
MD5 ea3c10241d4de2925729aee1710e5c71
BLAKE2b-256 eed09309f7849dee5d69e3d01b6b2a04f957dae1c228ca4982e75056a5d313ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp36-abi3-win32.whl
Algorithm Hash digest
SHA256 a9fdb25d69570836633ef4fde28b4a49da8de19ae7d9d4ff4723a301ddd95bfa
MD5 a243f5ed7b0db41cb6285d831f73e41d
BLAKE2b-256 a0894b24be4c45533c5a9ba882be3315db5d1d2deeb530efcfdf322dd31e54cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp36-abi3-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 188fb179b03d040e0c0ebcaa07aa68bdc2ed09f62f5a6fe44c26663e0e883eb4
MD5 ed813716829357afe1507f446db3590f
BLAKE2b-256 cc893df60ae18410e0616563068a5524930e2b6bec9cf62bfafa3fdf0c7af0f7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 6447bb95e6fae0d59d08716960b9fdb31b7490d8e44472e5f83832c92a022885
MD5 d6b41c291e632f49b332f58665d4070a
BLAKE2b-256 de9201be2e1dfa6103ea9bda3da3c0b640ce88648d2c67fca6b311eaaf940d63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a9c572faef1774a3513766516f88ee304e975ea53495118cd879e062e9ba2bfe
MD5 7b34cc55d76d7e40c6f1c54bb10193b8
BLAKE2b-256 f985417e0773e5666a7d8f37f261a0d85c290c21f2275f479bb1733304a33450

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp34-abi3-macosx_10_11_x86_64.whl
Algorithm Hash digest
SHA256 1df382eaf927b24dcdbbfceddac034da3aa130f1a8bd3934d3121d10d7a660bd
MD5 83728618a89fddc75002eef27974996e
BLAKE2b-256 58f9c1f515502dbbacba8583968867a4a22a414aef4d3c10e5da1f55608268fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 bf9ed257766f79b18be582e0b32cd25db03d95eb8f18b5b12fb9c630c1395635
MD5 e830362cc44f205ec71171b400da57ac
BLAKE2b-256 2e011056a70bdc830536323de15ad1410c84fe44d97bf3dd2f88a831ccf598db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b69eee626ffa049bdea77bb96c112ea82837fa5128d9b26aafbe545d2ff2fa8b
MD5 0db92ea8a36141ec0bc5a9d6ce97af3e
BLAKE2b-256 fd5559c3094284000f855545e6cf00e05ab7e272b48fe410e876e948d88f2b3e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f7c3496aa68571260a5a25351e659881cb7293482aa71906052329502d31feba
MD5 969897d7c1d1946f030af90d39f6358f
BLAKE2b-256 47985fdd329811c7f9a986f05692c2987b19206e195841eccfd2d7ac6529b298

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 2fb2019f27fa4c2eb393b2ed4675454b3a7b39fb01cefe1df4799a1343e59564
MD5 a7882a3a864758f092805eff46415f02
BLAKE2b-256 e26dc4376fa3edb57619f33d7890f9feb071a6cbddef562f3944326e508b6103

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 8528cd09ab71f654973e71e24650cdfedce4953dd28c8e8399954a0da4c48d20
MD5 17f4a4c6dc1a568547674ddd4e88b234
BLAKE2b-256 b20c2e30f94fe65b4af972966f0a43313ef9faa4471d43bd178edb9feb87cdd2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 174a828598ff1e90f1cb4231c18473bc1de47129c65ca3b477d7443ece3765c9
MD5 fb2b1d899bd7ccb2b2255e9b0736b1de
BLAKE2b-256 c3dcc05ba0a234113b28724ee653fc27eb6b11c0af1789ab5ec6eb08e55c87e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.16.21-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/0.10.1 tqdm/4.64.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.16.21-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 ecc0ec35952938f6b232d8d415206a068682b5bf3e4d0d55e2956817b299ec83
MD5 f3815558eaaee940a103c74eb35b37a4
BLAKE2b-256 f46d44a769382c7669e4b154f8624d3f81d22ee75ee2d442d69c3cc013595d4c

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