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.

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.5.105-cp38-cp38m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.8mWindows x86-64

hdbcli-2.5.105-cp38-cp38-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.8Windows x86-64

hdbcli-2.5.105-cp37-cp37m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.7mWindows x86-64

hdbcli-2.5.105-cp36-cp36m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.6mWindows x86-64

hdbcli-2.5.105-cp35-cp35m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.5mWindows x86-64

hdbcli-2.5.105-cp34-cp34m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.4mWindows x86-64

hdbcli-2.5.105-cp34-abi3-manylinux2014_ppc64le.whl (10.6 MB view details)

Uploaded CPython 3.4+

hdbcli-2.5.105-cp34-abi3-manylinux1_x86_64.whl (22.6 MB view details)

Uploaded CPython 3.4+

hdbcli-2.5.105-cp34-abi3-macosx_10_7_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.4+macOS 10.7+ x86-64

hdbcli-2.5.105-cp27-cp27mu-manylinux2014_ppc64le.whl (10.6 MB view details)

Uploaded CPython 2.7mu

hdbcli-2.5.105-cp27-cp27mu-manylinux1_x86_64.whl (22.6 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mumacOS 10.7+ x86-64

hdbcli-2.5.105-cp27-cp27m-win_amd64.whl (3.6 MB view details)

Uploaded CPython 2.7mWindows x86-64

hdbcli-2.5.105-cp27-cp27m-manylinux2014_ppc64le.whl (10.6 MB view details)

Uploaded CPython 2.7m

hdbcli-2.5.105-cp27-cp27m-manylinux1_x86_64.whl (22.6 MB view details)

Uploaded CPython 2.7m

hdbcli-2.5.105-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.5.105-cp38-cp38m-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.5.105-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.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 fb0128c0e7f2eb611f4160d21941a8efd77ecfda5dec0ca6f3f350c55ca37ce3
MD5 1b31c680dbbf492a3df35f458f092b77
BLAKE2b-256 b6282483567141137a0212bea6d75d20f28af1d499ea6277b808b9610b0c4f0c

See more details on using hashes here.

File details

Details for the file hdbcli-2.5.105-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.5.105-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.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0989988d566fe2b4e293899daeab6d6500f1b6f848ef023b529c42f0d01564a9
MD5 bcf40ddeb1cdb918f22e73b520fe29b1
BLAKE2b-256 7e435de4f6c2211abd5f8534a47408f0cf126dead65309c16642bf2efcbb3b32

See more details on using hashes here.

File details

Details for the file hdbcli-2.5.105-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.5.105-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.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 2f958d4cb1d00d44adf1d7261c6e74a46114dbaa346f151210170daa111bbca6
MD5 f99131cac8b156c1c4ff75f4c909e225
BLAKE2b-256 8f5da6f8600677f4b6defe52cd88feaf44c05e677a4eaa6abd8a3b92f932077c

See more details on using hashes here.

File details

Details for the file hdbcli-2.5.105-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.5.105-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.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b47ea59570a7eaa5d596e06a83e74d2268bca2b95cb0261006e273aeeeb2291c
MD5 8fa90f9a3225fe8bcab684e9f332302f
BLAKE2b-256 e4599c92b014e2a808a37e8418d98e80d2213b6a6a8a30a33a907fd6212a7a40

See more details on using hashes here.

File details

Details for the file hdbcli-2.5.105-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.5.105-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.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 d67de1f532519a613e8ba85aa06e94991653abbd3def30a5c718e2277e5e8a9d
MD5 38fa9f012911f13cf42d19a1c10449ce
BLAKE2b-256 f57ae3562c3c4e636402532bbe695294933b660bbda272142bee1ff8446e160c

See more details on using hashes here.

File details

Details for the file hdbcli-2.5.105-cp34-cp34m-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.5.105-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.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 613e8906e9afad5761a6b32d45861d11ecd398a9e98cb2f7e16e091e14932512
MD5 8bbf33f74783852221a8f3168f0ce364
BLAKE2b-256 5a55b41895ea2894dcc884386a6979c68072d2bb1289c18de896b5f134ed3410

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.105-cp34-abi3-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.6 MB
  • Tags: CPython 3.4+
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 4b9f4517f31dc4948527f62242d4dd2c9bcea9a4351d2ff4734bec75ca07ad8f
MD5 72714ee24e105984e5017e86431da17e
BLAKE2b-256 04a97d4862874c67fa0ecac0b1837fbcc6fd9b154f31400431a8be277a0c0753

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.105-cp34-abi3-manylinux1_x86_64.whl
  • Upload date:
  • Size: 22.6 MB
  • Tags: CPython 3.4+
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 dc4072119ee09bedb0aedd8f8499cdcad8e645289c22eed2cc9229ee96252a93
MD5 f02783855762d973efc5f4d1d61d6801
BLAKE2b-256 b8137b1096b32f62d96e6ba87a772cf215e799cbfa5a2c8132b755ba19fec14e

See more details on using hashes here.

File details

Details for the file hdbcli-2.5.105-cp34-abi3-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: hdbcli-2.5.105-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.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 c04bfd80cd5d3c923070e80aee05c3d5a2be809a845bce7af5898253bd7e79d1
MD5 98260d698f8e32854593e87a325ec482
BLAKE2b-256 f396cdb5c5d9ced73fd63bff27d5993d4bb937150cd8cfcf6bffd5c95fa31c76

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.105-cp27-cp27mu-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.6 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 af791e7c5b51bda1223c3ed2958a953f7076c19e10ec10007698b354e003e7d1
MD5 827ac2e480f82967cdb63a6b5aa7a10a
BLAKE2b-256 e5d98d2bcd36dfce1b895e3c34e1a382cdddd6cca383203f784d17a160240d17

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.105-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 22.6 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9f9e8cb7ec5ae3e7a92ede3a6025d43527cfa4b8efecf81dc0345fc1e637ed53
MD5 0615d6060dd2a72651fd14935d55460b
BLAKE2b-256 3ab6191f7810380a1c9de8d13a3479f3cf104d220482e05797b349e275281d4c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.105-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.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 fb491f45997da2b9b110cd8f68ca9733870fd3e1b68fb1ecf0ab3d6dccecf88c
MD5 42497c825bd564a78d26dba0a5ee9df8
BLAKE2b-256 472f394e6f2aa699c0fb09546fba29a005812826dd88e0b53d8ddcf75dfcafe2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.105-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.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 0aac07e2f04c4d1187420d427a96f15739641b6ea1ae81fb6702aefcc9d0acf4
MD5 9da432aed589d5de29e50f2df90cc140
BLAKE2b-256 d76bc201e91eeae5621695e5481e607e3feb5eebe576a6c5167e9352732b6615

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.105-cp27-cp27m-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.6 MB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 30735c3174fb7511f7d78e39d7aeb105db686f5ddb8bfc80344532b6baf81701
MD5 bebb580755725dd96099f7e7e60e3df3
BLAKE2b-256 57adf20f21cc2afe598f18ff3d44f542c5b11a2347ba785ced55d45b08ce7d8c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.105-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 22.6 MB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e2943c9f56e925b5cc0c3938939a9db5a7283bb07d55e417106f1ccc8da8e003
MD5 cbae5820a4da88c6bd9e981f3f3e7429
BLAKE2b-256 d35501da977bebd9e0e9073028759548d19ac413bd00bf07735acb5ea9eac2a0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.105-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.5.0.1 requests/2.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.105-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f3796cc57bd4ef8d123ae78056b85db2648e08e7507a1a7f2e42fa2e88d64d5c
MD5 76bbe7965d165ce2b26c650fac042e3e
BLAKE2b-256 d987296649fa8c131c7d19fb783857232277d74f0e32eaa1371ab9455a34ca3d

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