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

Uploaded CPython 3.8m Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4+

hdbcli-2.4.202-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.202-cp27-cp27mu-manylinux1_x86_64.whl (22.5 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu macOS 10.7+ x86-64

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

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 fda49f87c23c55804cd57fc6c353448a2cbb19dbe6a4c77b44b3c4ef9bc81a85
MD5 8f8a79321cd58aca8c650c7a9e2e7680
BLAKE2b-256 438e28674d8e5b0d7b4c0780fd3842e01f4718376069e756e9ad478202786dfc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 5c341529ec11cff0757db785a5f52b708fc5d68b0d3abf151bce93028402e833
MD5 24f015c8c4ee1dfb37aaaa6a86d167e4
BLAKE2b-256 12fc7ee3fbe2829c6bd2e7c4cda4ba3891bd7d4bc1727ada61c51cedadbc5a08

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e3171c85b6f995cf0b73bcdfa91e60f5f63401bde72d24fd97910c49c2c1f4c2
MD5 7dc104f9ab47d73e0c638581bc15f6dd
BLAKE2b-256 0ac16088bb9d13d3f6b792fd640c30a5e92e79adfb17b0f725accb2f19fba8f9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9f2f6605b0d0807f659c7089ba2490b939db72c7a1347711f13a3a30f0a764e7
MD5 5aae3983a5730038824d01688ec4d14d
BLAKE2b-256 f47c676420672829e1148232953da66f538eea6f7cb6add0a4ad8bd43012256f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 6d04c57763d9815b9f96b6cec14bed53549a18fd04995cfbf4c42cc09108d2ca
MD5 1a7977787ffefc46d515f0599b3adef2
BLAKE2b-256 f6ca09a6b739fe58c83b338debbb0dab69cad704fff45529a15b7b6b7d07a560

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 5a09306a8334b276894c54f83e912b96b1317a8b94d2edfd628f12acfe589624
MD5 a0974ac536c9ede1ad91f678e9275031
BLAKE2b-256 d18098e457f541e873e2791b1d38927b16d4ded62f14ca66fee04d0b637ab024

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.4.202-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.23.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.4.202-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 d6cb2c1b1d7dcacfc7922377783bc6f24e50ce8d45eed13aa546edf9fa74d0b7
MD5 964809c53ad3710ede89e55c4ec597fb
BLAKE2b-256 b782840fbec88e3e2558722d08901ea4d89798a5554902ec5c6b56be26e40fb0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5a30736fc4cbdb2c3056c3ee84974c9cc906d63236d1be164d30e6d49655500c
MD5 16f440c0dff980224f70879f2d68761a
BLAKE2b-256 ceac9d34993126875fa5ccb069686e0725776a567dc6d5e7080a4e5988d5f278

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f78e1d4e244758df0e691242f819b2cf0c752f1a1542f369af699d790d494124
MD5 abe0090c6782c7c8d5f118c57be0ba2a
BLAKE2b-256 4e0ae93b0d38f03a46ef53a429e1c635351992660f94749092f56c3e373e43fc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 fd836f0654bfb23a101fc8d9b52b46be24a6831fe78f695ef185fba023226a22
MD5 43c3304d05ab5e12c91680f949fab202
BLAKE2b-256 b6b614df1a2092b88b32274a259e52294fc1b11503c4c408b221964be660a007

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 13d3c181c05c540defb24f37ea1cb472c78799178aad2821656916e0845b5230
MD5 7c971fd7e752d7468e6332526183430f
BLAKE2b-256 15bfdd43d208b8258b2c2dbc2679575484e2e0cae7b9e75138330348c80447b2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 48f2fb12932753ca5114df5a9c5e6dae911b0151d8ce33c66eadde848f371d58
MD5 dded87dd2ccf45e5ff79510c7438cb91
BLAKE2b-256 45b5632473da36325040b1d8cae84f9cd9ec8f388d80c395898d71f713a05cb8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.202-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 6e1f5e90b749c6e261981a9e4d2b3e1931aca2280df9619481d506956e6322f9
MD5 8951c840290584bb05ef682901c63afc
BLAKE2b-256 dd40e4c36ad927c0d386475bb43eb9ad27b28bdde8f29b2857f2be0a521910e2

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