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

Uploaded CPython 3.8mWindows x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.4mWindows x86-64

hdbcli-2.5.101-cp34-abi3-manylinux2014_ppc64le.whl (10.5 MB view details)

Uploaded CPython 3.4+

hdbcli-2.5.101-cp34-abi3-manylinux1_x86_64.whl (22.5 MB view details)

Uploaded CPython 3.4+

hdbcli-2.5.101-cp34-abi3-macosx_10_7_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.4+macOS 10.7+ x86-64

hdbcli-2.5.101-cp27-cp27mu-manylinux2014_ppc64le.whl (10.5 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu

hdbcli-2.5.101-cp27-cp27mu-macosx_10_7_x86_64.whl (5.5 MB view details)

Uploaded CPython 2.7mumacOS 10.7+ x86-64

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

Uploaded CPython 2.7mWindows x86-64

hdbcli-2.5.101-cp27-cp27m-manylinux2014_ppc64le.whl (10.5 MB view details)

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m

hdbcli-2.5.101-cp27-cp27m-macosx_10_7_x86_64.whl (5.5 MB view details)

Uploaded CPython 2.7mmacOS 10.7+ x86-64

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 1a8dacfe84891da99d0d39a5ecaff23aaae8a8c7ce9df1e956365f0be7fa3ba8
MD5 2dd67450051578602a4d942f68c2f7af
BLAKE2b-256 cfad9e557166338f606fdd0d2a3ed4eda05a4d7bf9b0d047360bb34ba954465b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 aeb424b8af6cea02eff95db7538cdb7688d75163284e013a3969ada2d9548bf4
MD5 973e671b5a3dfb5b57fdd02510538d82
BLAKE2b-256 14c5298661a49196d02de2332b51371f7c106dfebc5cb24f87ec725bc0e0e8e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 ea6a2d64ae9660259b5d97ffe98f0dbacd734a3bc02c46ba3ee962c74daf64ec
MD5 7aaef25e31653f5db3ee8f5effb94252
BLAKE2b-256 2ed375557540fb56d2ffae6a080e781f8c55f7553b2dc2cb281064ee7507db76

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 e1714297a0bad7731e3b868979f59963b8c2eb5e6b9c839a90bd2939fd2be0c3
MD5 53cc457c7223ad8eca2d3e2982a2dc21
BLAKE2b-256 4f99b514f0708fcd4e8814eb8981e7d963a2a0ee235f569081de3f316bba5168

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 59b719a07f7989123854f354845064be42c3ffbbaf84a84dce3950dd944e0e88
MD5 8004ba2900636d6c295c443550217ffb
BLAKE2b-256 a397796abe97628e9c070d1d80a2270ee7d79ffafaf72e8b0446e107a04c7be7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 d9876555a40765fd7b955c64fe52b763218464d8ad08484b68f8454509f6078a
MD5 aba826969d7d235e723c282c42739990
BLAKE2b-256 5989a86792b9ef6721b65be5be06a4038c8b64de3565254e82f94407aa7adfb4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-cp34-abi3-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.5 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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 33d996b8295f0c9ba09e9d341729d9e7028dc621b52508f531ee2922fc54a53b
MD5 9f3bcfcf8ca886e72866245c7a9cca70
BLAKE2b-256 6294faad7a8eb99451536efcaf3ade09680b0c765be8358ecb7bd45baf8ea12e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-cp34-abi3-manylinux1_x86_64.whl
  • Upload date:
  • Size: 22.5 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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4cb19370a0a74fc645e708b67256a3e5f6ae2c30634cc500502a7ac34d5b1891
MD5 9006f039b21bebe5de17d25e759a880c
BLAKE2b-256 695a261ec0f973fbb8d42b1376b8357fe5baf987ef7dda71ab716d6564028d75

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-cp34-abi3-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 5.5 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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 adef32dc9fb464a64e15bbf697968c5f4c5018deb991a2a7508dfaaec1c0bcda
MD5 5feb16130e866df1c691ab77c3675540
BLAKE2b-256 63f796bb39a40a64654651728a53b5db09e46628110f0c0e35dfd13339018231

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-cp27-cp27mu-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.5 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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 e7e9f6a29722647e202c17b473f16493ea642c87276d9cbb69a221366c374cd5
MD5 04ae7be47cdc6baae34d1e8d156530fd
BLAKE2b-256 cd74f77ac987b7661c99c9340e220cfb9f90bbc08b7e6e598e570f02bdff834e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-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.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1408aceea9f7c3c53357fc75556ec06c821c422389830a344ad6092a3353f7d2
MD5 c8b323c4d482c41029b6ae7d1ed44251
BLAKE2b-256 83a9340f81fe69d7f0232ba92c59c97e0fd3d03d96f9a9cd17b105269ab68f41

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-cp27-cp27mu-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 5.5 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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f212b31690cff95181ec679365cba5737dfb1f268132a6cacfbce34065a52149
MD5 0762ee7fde08cdd4c38e311e9142105a
BLAKE2b-256 3dfb375dbd784bff8690703d7275845326eb3d89737675601125fd9b6950508e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 afc4e6132f8f92733708f47e2e804add6e90b858ec61bec0e7e209dd35084695
MD5 f1a46688ff0d27546f75c7ebc6b6f519
BLAKE2b-256 d09694d28b3de9a0217ea7b83559f5395cd56e54773b6fff3f75db4c0187b8d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-cp27-cp27m-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 10.5 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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 a4aa713271a51ba32d06da9414a48dd2d7e85f9bf7ac3bffb9d844623bb9b735
MD5 fd33015629ce5d39585e69008d697836
BLAKE2b-256 211b088ec39c5c53341602abd59e3f055647025fe90de166d2a09062463209fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-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.24.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 04ae7530734bfca93d47caa414e5691661e7d401383139b4e046ecea4185b22e
MD5 f574a87b10703287670ca7bdf2bee542
BLAKE2b-256 0eb504e9769d4297a8cdc984605ef07451d0a102ebfd9448cc007affe5661dcd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.101-cp27-cp27m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 5.5 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.47.0 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.101-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 ec20816d0d83cb9a6abded1394bd3392b67d6f7010d5c54af6d5f469de7619cc
MD5 7c13f34a1b7b6bc6f893caf38f5347e4
BLAKE2b-256 3a6bd28fc62954fa97b26d7faca0fddbd648ca3f6208914b181158988a15d6ee

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