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

hdbcli-2.4.191-cp38-cp38m-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.8mWindows x86-64

hdbcli-2.4.191-cp38-cp38-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.8Windows x86-64

hdbcli-2.4.191-cp37-cp37m-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.7mWindows x86-64

hdbcli-2.4.191-cp36-cp36m-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.6mWindows x86-64

hdbcli-2.4.191-cp35-cp35m-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.5mWindows x86-64

hdbcli-2.4.191-cp34-cp34m-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.4mWindows x86-64

hdbcli-2.4.191-cp34-abi3-manylinux1_x86_64.whl (22.4 MB view details)

Uploaded CPython 3.4+

hdbcli-2.4.191-cp34-abi3-macosx_10_7_x86_64.whl (5.3 MB view details)

Uploaded CPython 3.4+macOS 10.7+ x86-64

hdbcli-2.4.191-cp27-cp27mu-manylinux1_x86_64.whl (22.5 MB view details)

Uploaded CPython 2.7mu

hdbcli-2.4.191-cp27-cp27mu-macosx_10_7_x86_64.whl (5.3 MB view details)

Uploaded CPython 2.7mumacOS 10.7+ x86-64

hdbcli-2.4.191-cp27-cp27m-win_amd64.whl (3.3 MB view details)

Uploaded CPython 2.7mWindows x86-64

hdbcli-2.4.191-cp27-cp27m-manylinux1_x86_64.whl (22.5 MB view details)

Uploaded CPython 2.7m

hdbcli-2.4.191-cp27-cp27m-macosx_10_7_x86_64.whl (5.3 MB view details)

Uploaded CPython 2.7mmacOS 10.7+ x86-64

File details

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

File metadata

  • Download URL: hdbcli-2.4.191-cp38-cp38m-win_amd64.whl
  • Upload date:
  • Size: 3.3 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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.191-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 17de556f667c81ebf4e870c4d7f0c3dd6456544b90dfd616f6c1eef65d7f7498
MD5 8c70671c65cdd1399f7d325a0c1d85ed
BLAKE2b-256 61abb0da0e59ef76d091086e7e0fb4ec243c7e5f6df8f283102a524ba8b66a6b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.4.191-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 3.3 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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.191-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 25c3579b95c9b1c19c4b8fe2a2f7a3a6d2792eb169d5ba68a9954bc96066035f
MD5 58abcd3e9499024f973180d593f468b4
BLAKE2b-256 59e7b53694cd6970a05ae65f9b67cf39fcaf6d516ae00bb4c0bb78ff913864ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.4.191-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 3.3 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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.191-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3ea4532757cb09c04047117904521f5d21fa651898c95af7e0ffb3a9146bdfd8
MD5 4a59f1656f4ee50641df9c9ea3ae7071
BLAKE2b-256 d8b55d60428f30f1e9b4940ac99f62325f465fbb4e4a861dcbe0ecef85fd12e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.4.191-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 3.3 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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.191-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 3bab28fa98167c56daaef198480ee737718f222bca454077fc0f490271b1b2cb
MD5 59240dd08e7a8f949b587c498911478e
BLAKE2b-256 34c3ed2abe1e816174972d82ec704ace33d6562e71040c9e7bb4ea630ef6c731

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.4.191-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 3.3 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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.191-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 f7c16f0779f1be2e9e4a62417092953bda7ad68235147c140c92722f11e73eed
MD5 fb196708a19cc6e778d67668e1b393dc
BLAKE2b-256 8951c7e5fc6f3b51e0d9cd70008f2c645a97372541cc340b593530b7abbf62a7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.4.191-cp34-cp34m-win_amd64.whl
  • Upload date:
  • Size: 3.3 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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.191-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 78c4e4859e8a7af7d6881e276c766adda65d92f1b87e9c54f78804332b9f98eb
MD5 a98aacaa941ab9d80b008f3294523c85
BLAKE2b-256 d630e8eaee0793992d8e517b3ea42fb3c966328e300332f87a1c1609c2fe0611

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.191-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 98720129dc2b6f0e145ddbe30f6acceed9658d1420d10fe9bbd91239643fec19
MD5 3ed7d016a72d6c175f1a7260d79c0301
BLAKE2b-256 ebd4cc0576835a6c84f5c5fec6a6051233f52c20b231f3fecd795c20c8715a43

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.4.191-cp34-abi3-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 5.3 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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.191-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 aa8018ff4000bf56af564cdc49747c81f5ab2dff490c126f4eb1096181babe71
MD5 7e4645a4d584590be90391aff861c750
BLAKE2b-256 a9e3a8acb9adc00b3a44df0f8e65e962671ee167d391991e7601d2d9feeb9b8a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.191-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9a764231ff7b6584a5c1ceb22cd093c1dfc02250d2261ddfce5822701c8ead73
MD5 b2e0b860ed49200e7bdb3507d4266a99
BLAKE2b-256 a69d97238829528b6687f4f00dc2c79256cc8fb88dc9347b0a161f8e606ad102

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.4.191-cp27-cp27mu-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 5.3 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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.191-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 3758f8d403baa61ddb888e5563cdb0a4ae72c0dd0b6ae6969f09fd4f1f62a62e
MD5 31378e143d883142cad2acee91c9c80c
BLAKE2b-256 d0b28b50ad2223abdeabe630de14734ad16330e42021b4b57d638f8eceecb2d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.4.191-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 3.3 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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.191-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 63008b9bd8001e145794ccbb2a831acafc6ce2a326483447e7c86bb25e854735
MD5 19e916ec19e1d9d41827bebf38726352
BLAKE2b-256 c4d72f94de0465f7574c6f53ee911feb255f1c823e28cfbf9ec7de1dc6a4f50f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.191-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 e2a421db058be81eff135593be1f3bae9583055d49d3ec690297f8ac1972d9ea
MD5 8d5d128bae1c5b59b5a4d597aa19aa39
BLAKE2b-256 fa25003804ffaf1b76b0fd831ca64c6a0fa453edcadd1c160492c1c0f9e139a4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.4.191-cp27-cp27m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 5.3 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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.191-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 51fd11d92adfa979ed18d764fa39d8d519692521ebb72f4cb7048fc65dcedc7b
MD5 4d632babdd1a676b968b838fd69e7ccb
BLAKE2b-256 2eebc0cbc6eed0825a5b4359baa9518b80b434bcb9e89c5ced67dc8f9f264db9

See more details on using hashes here.

Supported by

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