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.

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


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

hdbcli-2.6.64-cp38-cp38m-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.8m Windows x86-64

hdbcli-2.6.64-cp38-cp38-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.8 Windows x86-64

hdbcli-2.6.64-cp37-cp37m-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.7m Windows x86-64

hdbcli-2.6.64-cp36-cp36m-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.6m Windows x86-64

hdbcli-2.6.64-cp35-cp35m-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.5m Windows x86-64

hdbcli-2.6.64-cp34-cp34m-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.4m Windows x86-64

hdbcli-2.6.64-cp34-abi3-manylinux2014_ppc64le.whl (11.2 MB view details)

Uploaded CPython 3.4+

hdbcli-2.6.64-cp34-abi3-manylinux1_x86_64.whl (11.6 MB view details)

Uploaded CPython 3.4+

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

Uploaded CPython 3.4+ macOS 10.7+ x86-64

hdbcli-2.6.64-cp27-cp27mu-manylinux2014_ppc64le.whl (11.2 MB view details)

Uploaded CPython 2.7mu

hdbcli-2.6.64-cp27-cp27mu-manylinux1_x86_64.whl (11.6 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu macOS 10.7+ x86-64

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

Uploaded CPython 2.7m Windows x86-64

hdbcli-2.6.64-cp27-cp27m-manylinux2014_ppc64le.whl (11.2 MB view details)

Uploaded CPython 2.7m

hdbcli-2.6.64-cp27-cp27m-manylinux1_x86_64.whl (11.6 MB view details)

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m macOS 10.7+ x86-64

File details

Details for the file hdbcli-2.6.64-cp38-cp38m-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.6.64-cp38-cp38m-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.8m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 bcaa0a43a84b1fd4228d40a30c917f6253db47c5f962f398c0cd6e797b712a40
MD5 2556b26682f7089409a43116b7955b42
BLAKE2b-256 cf1f05f2f9ee1f6c9c8136a8383662c73c7e99517d4f5680fe4f02913c52f9e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6cc053c3b064f62d721692c1ccf52971c396a1bee5556d6361bbc1f27b411cb4
MD5 f139d7ace4a9f44c12ffbc65da58b3d7
BLAKE2b-256 cae3edcb645ed5e5d680a1bdc0ca225ddfec6487928cce6ae5a58367c05c01ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 91f8fb4576c5c4e1714c1bfdaf2d3d1b9f94568fae3674822549dcefc30ccdaa
MD5 dc68eed065da9e067e76a55f201543a6
BLAKE2b-256 7c865890552599ac21529440794addb19d11854037fda36d32c541fc3bf0becf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 782448ef3f993a518f797013cc099a04d1d31a96731aa92584c116765e1c9050
MD5 d07d86ba81aa74657474e786bbc2a5c4
BLAKE2b-256 39d11d302b3f23d664ed24e11c2104e32baf175a7d8a5d01b74aa9867d35d86c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 a66a89f1660199f18f761ed453f9c2614f5188be98d58580e2dd72417e84455b
MD5 c162954c013b68d3a749866ddfab9a32
BLAKE2b-256 f92f224f78c9b32349794e47ca6f63b74ab44d72abc9fd4ce0d7d6f2ee68fae7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp34-cp34m-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.4m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 9e9fd6419fc0f57b366a5f4f0d855543f365d4ba170bca88be4223287c46ef07
MD5 c202c134ddca0fdd6edd910793dec514
BLAKE2b-256 956f19d06f3b2db49b05ed109294777f9cce397c7c479c4ead8f307d2905ced2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp34-abi3-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 11.2 MB
  • Tags: CPython 3.4+
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 7d0ff91870940ef7b119d22d64f84e35545cb6c5c15ef483c115ca7012b51827
MD5 ad758692b6cba6a8ef0481f9fb8308b0
BLAKE2b-256 f9a8bb7ce1086c3645005c2b4793c7d2eb9f64ac8438bbb6a2afb4901d4e548f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp34-abi3-manylinux1_x86_64.whl
  • Upload date:
  • Size: 11.6 MB
  • Tags: CPython 3.4+
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b273220e5b08291da0b4e0c056dff893c42b7711c5992a72bfd24ca2a42657b0
MD5 510549fa2f906186ca8a77a852b87846
BLAKE2b-256 6bda191825ac97b35ec83241c4bb2b86bf516d362a45cf4d4c375491bc9e0ef6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-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.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 b85c65bcc983a00601624858075999e25a8bc2bec9fc260c92fe41573e5bf775
MD5 d0a696c9779d462e75c8bd37fb8bbddc
BLAKE2b-256 4e226d0b47878fc8b47fbc1fc95f2d5d6f071390a0a7dbbee27ea3e74d8c8988

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp27-cp27mu-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 11.2 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 8c033d977d901c54e793a19af62c56e3b82bdaee07a77df33401e382aaf38310
MD5 147c145a9dc1355f017ebc22766331c8
BLAKE2b-256 e3728b8469dd71ad99bdec977a144a1d8a045be0e850756fdd0d670d5947de40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 11.6 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3eeddff538e1b25236774a66148c870e1c01a43d298e4df0ef0359384341f8ca
MD5 8d83f9a765078c8922672e07ceb1c5f7
BLAKE2b-256 d3b17723ba096108ea720d203fd409b111e2363c5fdb93972b7d1d8d4e802267

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-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.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 54621eb6cf669f5304b7e828216dbdc465eba77f0de0b3b15599483bf34ae680
MD5 4f73e9793ecff065c7f6396ffbbd8ac8
BLAKE2b-256 a43324a136b4bc81029daa82b7072f59c34f452d942e523b076af83aba480344

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-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.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 40caa029257bfb3035a21b207682a5c79e64d35d3c31da8f0b8c237d4c656fb7
MD5 84361f7f9b0877c002f29e796ae98f88
BLAKE2b-256 b842956b872679324007b2a037344288a7da37a2dcae30ce44a92221d6117da2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp27-cp27m-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 11.2 MB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 5f5e2d2f27d77cf088489019c27f5b9054eb1bf7b755114dcff52702184c1526
MD5 2ed9f5832636ddc1efeceba0cd66bb4e
BLAKE2b-256 9a4c411df00eab19386a83522295fb2016d6ec6552b41e612928760e6e873a66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 11.6 MB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 06b1244fb1a56d34ac701b13ec4321d9303150f378ea06bdc3209e758a425ca3
MD5 8a98e059968bc1051110dba8b2979622
BLAKE2b-256 5aa138e6aba45316aa76235bf6b799df011b5bc38beffc053054986d1270c81f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.6.64-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.6.1 requests/2.25.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.6.64-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 412298d0a167ffe2988d134083214ffe8278f0fe99cce856ef12ec0e91dd29a7
MD5 e2585d81e958842b5cb780360fc9432f
BLAKE2b-256 abff9d911ffb3a41f9ceabe54c0ca119d18808874660a79cecc25204de8131c3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page