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


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

Uploaded CPython 3.8m Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4+

hdbcli-2.5.86-cp34-abi3-manylinux1_x86_64.whl (22.3 MB view details)

Uploaded CPython 3.4+

hdbcli-2.5.86-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.86-cp27-cp27mu-manylinux2014_ppc64le.whl (10.5 MB view details)

Uploaded CPython 2.7mu

hdbcli-2.5.86-cp27-cp27mu-manylinux1_x86_64.whl (22.3 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu macOS 10.7+ x86-64

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m

hdbcli-2.5.86-cp27-cp27m-manylinux1_x86_64.whl (22.3 MB view details)

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 fa38b446c73fca8b83a445f2e74bca70ce033309325ca237b50439db28726793
MD5 3d05138277775ac6f8c0aeb642b036dd
BLAKE2b-256 596c7ed50d3aa9a76a1bb0d2ec47b5e172f3a890662376c18164e9efa896447e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0d0aa2aba605145e3bf6bbba62f008daf21c8ecb3892236ee94ac82e4435cbc8
MD5 4eec238438b5cbd72484b49cdb234799
BLAKE2b-256 a7cad675f90ac25e2e49f77d269dd2c565e06ed411f900db33e6207d56ecaa81

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 549cd8ea1d380c1a05eb19c2f55f1378a331c96deaefb34c4b12dc215ace718f
MD5 0e5e1ac1970ad4a048153c564b311a09
BLAKE2b-256 13bdff2cb7eac723e0915c685a2570f1c3afdd546fdf92de1cfab40862906c63

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 785bac2dd54c33bb1744a8466526eee0cc18eee1b6e57d58cffc6a862b740cf5
MD5 54361f317360c8eb7c976056bf1e1674
BLAKE2b-256 5d87f960de6ec34c2f3dbaf53c3c9fe90bc5e3a754440cd7957384b5d24a552e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 1231091aeab1b4ddb30e8ceffbdeba118124c7d8edce46f3fd8e23cefec9a0b0
MD5 dd1452edf9f459f0c92dbfc29adb6c05
BLAKE2b-256 d56d80c56281e9a443b2d5fae0efb971cce11c10afa12e2451668f7bf4622ab1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 3832e4c4e586ab9bc73749140d4746e6effb8bde7d612e347d32767c45ced0b6
MD5 4c0571b5fb5cb92be146b88690bc3782
BLAKE2b-256 0379fa8141d82577d417592e7b24f72aec32fd37b6deb0457e2359e07225876d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.86-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.86-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 034c88588d3bd1b4628c63d274b2fe8ecc6561da07cd5dad544d83f2bb59495a
MD5 c2bee722588e09067f09340801f2dcec
BLAKE2b-256 d8643a6a2984e8194f0ab66a7e2747221b7799d0fce0f67c3bc10bf00aaba5cd

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cbe9a86a520cc86aa89e7f683a93885b07b2f984cf63308e7054d5a091953004
MD5 e7edf8f64e2de14925dc3c4f25765bac
BLAKE2b-256 3238e51372dbf6d9181839e33c07128bac9fcbb651a7ccc777cf7b2ff395109c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 0bee176d0a627f5e6210ad34a74a0b3d8a80b9ad9ef74b4bf3912acb2ae7e5e3
MD5 f4243e93094d01bd6a53d0f25f82ed7b
BLAKE2b-256 9c8fb7f304b5e975f0272fe81a44b42981bac79fc0b5f7fe1d5196ce366301ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.86-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.86-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 12f9f93eb8258aa937701555f547b10109b9fe72638bc227cef3263edb616f06
MD5 7113a7a5c036857e04e68a2715951ad3
BLAKE2b-256 14a68ffe6c3f19f93baac402b7a1a2518184c10d3b3d2aae8d620554844943e9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.86-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 22.3 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.46.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.86-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2881ffff6e08c0d1c6d0fc6e26bf071fecda29aa9415142d2925f35856da384f
MD5 b6323fed585932efcd389f972ecd9a6d
BLAKE2b-256 ce4e6e551eeb81a8b429e71753e76ff7f67d0b75e922434d4673ae0032d6b218

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 dfd747307b5cac3b5fbb8ab0757781f3c31e423e250702a6449209d660f9d087
MD5 b595a50cb4305af4d9e4dc43164278e5
BLAKE2b-256 adf67e7da57713ea7552f21527f22997d50a74f3c58546824f826245f5dc983a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 74c0261aae34df299d7cdf1c91135bfef1a0cf1b0bad6d8bbc3a9d34dd797fc1
MD5 426df00a85aa743e6da98cc4850fabb7
BLAKE2b-256 66d99e97ff4ba506a5e5287ec5233e1ba63822496caa1f738beb9f27175f340a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.86-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.86-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 a3c3ba8045d1fb88b4ee793250b25097b00cd64994b7cddc689a09ba69a37069
MD5 efdbff3afbfe562f5ed6fec472eabfdf
BLAKE2b-256 02e5ef2bb56cca98ef2a5006cfb84bde845eef41ebd65bf7fbf33e4e953c02cb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.86-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 22.3 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.46.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.5.86-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4bf762ab9dc1e5043832462862e0c07a5adfcff9206ec259230abec79d0cff58
MD5 9222599d34a210c5238afb071be63124
BLAKE2b-256 62c09362729463a16687d5a2e9cd640f4249fce5ce6242c22dad46030a75a91e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.86-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a2a55b92d9143d303994b9e93ca8728ff4af9103dd0a3e8946b6be3b20985761
MD5 5a8ad8b37009c625b23091b0e05d33de
BLAKE2b-256 f904673f5b336a162c2ecc1b38267da0f01785301aad19f36e40bde739f92d70

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