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


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

Uploaded CPython 3.8mWindows x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4+

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

Uploaded CPython 3.4+

hdbcli-2.6.58-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.58-cp27-cp27mu-manylinux2014_ppc64le.whl (11.2 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mumacOS 10.7+ x86-64

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m

hdbcli-2.6.58-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.6.58-cp38-cp38m-win_amd64.whl.

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 577970f1256216d30ad06d480c7c4e08da908b7c62c1231fce5092a6d9caca4c
MD5 9c8e070171c18d795172719886ad67e2
BLAKE2b-256 034496c341e1edf64b2f47d06096de2d53a502b02e21a9114ab0a60124c83cfb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f463a630f24834bbfa4a46d70c7f4fcd08a62a8b8eff7639123f545268cbaeff
MD5 771bf786f9a3bf61db48f6fdb8100402
BLAKE2b-256 38b520a36f9a73ba354b3f6793dab21c8f61aa20587a529925d48e5943733010

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6f6328f4e1a1c762364d6555fd79f035bf420864ca7aeb05bc4fbee5c1607dd6
MD5 64494c0148827cd7c8d8304685500d27
BLAKE2b-256 997615e2296ddf5abd256f2d3b17f12110681b594cf95ff3cffee503fcdbb2b7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b22d2fb41630fd7ca092bad8fa977c66d59c25d5ed319e791a9a12755cea1100
MD5 170073c9dd362d3bc30b4d234b0f09b1
BLAKE2b-256 89fe88961f79e66b34f0fe650a4a4c76bf2d4ab2bd91f8a2397908459f584c46

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 4cdeafc64ba7262b0ebc85f03aecf313ef565422725bd2ee149a50e30bd004c2
MD5 850006e6c23df620e693edf053951b43
BLAKE2b-256 48a35c8e2ea45ffa7a28d476c1461105643c594a420d3b3eb6a1deb1ed2bad5a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 7e462a95585ff553f92620c5b112726df69f1e0f982c09ccf9898a0139deb971
MD5 00250b547534e68dc7abb137c845f822
BLAKE2b-256 c4d6ad09eb4eac617d6737c63ca493b0e75ba206b75e5e34f8cc6e8db4d67b85

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 fe88ca127811a975e9ce8db1ff12dc99427b2c151db9b1ec6d92105c7ef7e974
MD5 e21e2f233e2d8bed5c3250f70b6f8217
BLAKE2b-256 05f8db1d8a23e87fa0cec360273a9e7f49a20cf90c875d0d319b1a5f2b2fbfbd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 b89b6f077e500c5bf603905e42b05c154230ee51323a54d33420a06e72c4f845
MD5 a1d54e8bb0f18571400f7f2d92fe5165
BLAKE2b-256 45c34cb46a6df8e7872b90c4205e19a6aeec9b8843333ede84a26684e1efa827

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f320f1b7738debff4f0bed5bb0a2ba3d716a44b059be53491ef58e2dc6ffcb05
MD5 55be9f07469ff0bbf978baa015f1e16f
BLAKE2b-256 676dfe541d1808abb6b9e249a0ca1e8619bb78dcaa3f48efb2ba350e628db5a5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 755e0c3e382151b7562fce26f561f10120edddf1f63bc4b2e22af3d8eacb6a0e
MD5 11d1f17daf9d23f53432e1fa0faff7fd
BLAKE2b-256 d809c9627ee06ceb1c9bf822195a35f412e80f2998451d9ef713dd393284c100

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1fe34fd015da26405db0f92c6b55435dfed0170a5549079e96818bd3b988b29f
MD5 9daf54b84367a36064c2aba6a4e17296
BLAKE2b-256 1aee168011d44aa73c27eefee1249f9c16ed06a2461a9e90e8da389f5f7769c2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 91316766888bda1e6cb613798d89320de4de4663a13fa27b4ee19b85a0aa50ff
MD5 edabd44079cb6c996d96d4e171d1d49b
BLAKE2b-256 402133599d2fc1c3d1ee7e6f91dfbe2571b76c22c8f06c00853b72607ebe149a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 826e4363baeea8bb1b2ec70e36400031ad66a1bbb016072fbc2016e1311af1f9
MD5 5b131aea9a346d7fbc6955ffa02eb647
BLAKE2b-256 d2e9dbd350cada3ddcd1c9d17670e6227a2e07852bdada1fd444c435271a5248

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 47b3e3df714f184ac19bccf052873365ed647a43e891af74abca40db1811854f
MD5 f211b69f60313552bb169062549ab947
BLAKE2b-256 07a4492e2543e0e210c85f49185e012d856647a08b5a49ca3072f1540418aaf7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ee843c21047410e49ff8f4ac474482352ca60c126b99802c4ba376c1cf0287bb
MD5 949dcb78caf0c249931b7c8b03a224d8
BLAKE2b-256 85fb03d41c6c0ac777fb65187f6e2ff231471d380a6b227ead1069833ab8154f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.58-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 baeda20d05f0cc97ba421f621aaeb62ac56570f7dc99b5518041de6c49bebb17
MD5 8823caa34d9e4162a39b571cd71b1c8f
BLAKE2b-256 614f69c50359c432a820651899a5e748fcb07da34104fda9da3c5fff5f0c5fb0

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