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

Uploaded CPython 3.8mWindows x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4+

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

Uploaded CPython 3.4+

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mumacOS 10.7+ x86-64

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m

hdbcli-2.6.61-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.61-cp38-cp38m-win_amd64.whl.

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 52ea4c17558e884902972fe803449bf95e7653a863ac7f70b8ce7d87d8f5499a
MD5 189415774f2299f92212ba2b0a723399
BLAKE2b-256 87a4327adb7241b56bc9b131e2fe16c3246775538a9f4fb9e295b87b80c7b917

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2f12ea9d6b21cf6b41d60d0547c0aa2c71a773c1b1708dec455539a23005964c
MD5 169244289b2edb9e77befe2da1880080
BLAKE2b-256 311c9fa5b1c1f7a86ba424ae83b38e3c8a64db2766d4e93835446c1312d42bfc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 7718313e13f71c45169ca4b41d10b80999ede880b7d80c1950dcd0b0c2c227e6
MD5 ca011f06d117f9cc41c61e2d9df758db
BLAKE2b-256 a069507028682a3699d4a0d1a0a0f00d73a5d3a179294154b38e8b386271ed83

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 599dc52257b992308d6d4ce3592cd2b65d9dc094b6a76173a74b82bc787ef9cb
MD5 c888ea2af4c2fc78827e9f2b3efbef9c
BLAKE2b-256 21945193148269921f2001e37e30621ee02f9c7dba960f8bbbfd147a4b447057

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 40014f217ddf3c6607d782447028208a3777346015fde1b8b6f577f0085ef164
MD5 710ab523a24d7ee46f3321f498d87db3
BLAKE2b-256 9b64513ee0d3c9f4ba9d2516fac38bf651218fbde19723d3147bb9c6d77aa691

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 99f17e29fba4d49ec0b10ae1b235af541f013e08361146f668012ed623933a50
MD5 2f407d817dee2b80a3c05550e1ad89bd
BLAKE2b-256 01564fe90921cbb9ebab6e3a413650ee07fdb1481403e0f5f0e118b510bb66d3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 fd3ad91d3f9db696ec3bc82b307c7b0fc7f6c88fc9963ac335cff3a2b7b3ba87
MD5 44e9f72f999b74bd018370c2bc51357b
BLAKE2b-256 5d2d4efd830ca3eeb781d342a08742350abb290347cffc151b8332808960be58

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9e8d8806508f6c744d35a2ac0eebdb1aa1a97d2b3e5a5a481d1d1a387a8fb8be
MD5 017f3a3f319eb59f29abe85fcd6b7afd
BLAKE2b-256 010cbd1f6b036369a515ac9f566e09c24fad682b6989b3ea3c66a4b0e3c3a9d6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 1b82d6c5e2f2eb4547701d70abb3fd598eb51e55367c2069d8a05d0de23affb8
MD5 c2d9cb964e684ee46fad54e655382398
BLAKE2b-256 fc2e6d5d7f4b807b7ccd1c4ddbfe7a871a422c60a78b13089905dd96001f8528

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 730744182053f0897fb8366e662e65499a0658eabb9bec3e62c62a8c527de273
MD5 9e9151f585066b8bedc18b4b6df91fbd
BLAKE2b-256 90ce607770de15ec93a027590d64a45f5a5daf1d4da8df4865bd4ca4a0d40b3a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1ac8f1aafdc4bf1c31c783cc02ed5844446ed37dbbacd15ca944b08fec74e793
MD5 f3959abdcb9b2cc5888a0e6356074097
BLAKE2b-256 17644eed4356c42c9afe508bab94d5727c12d7b9f8223246137022f1f8194866

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 d8b4de99f21e212b06a77c421265f4fb111dabcbbc4899b6cff1b3df681e73b8
MD5 46112dc0cf1e378c10b22c1864a8fd28
BLAKE2b-256 146a983a8635721e24290bebe0559a2fc957039946fbb1927c994942e3985523

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 77d805b2ef3817dc14d1b22a2dbee119990af6cfbf243edf039422626ca8d92d
MD5 afedcef3fa09dc74bccbab59baff2ba7
BLAKE2b-256 c4346ac3faaa6c0e3871765826594ed785fdd137db60404a7e0f63111e96f1c6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 1a3297223deb3bdc739c549170a89d2bec5e3709e535b18f791e395e26fca813
MD5 4a06c237caaf2e7cd2ba90ac9a94a033
BLAKE2b-256 f74ee92faae33d54cb9bc14180d84e24e80c5138997d62166e754e320d9ffc81

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 493fd5a35950c264c92624385c25f84d29c2ed3e283ff2bdeeca676cf8418220
MD5 c0bd9ff08f8a0583519a5e0a94d7679f
BLAKE2b-256 e0b7ea8c813b0b13f5e641e0b2e2e580c7b1876818e317c46152afb584962a0e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.6.61-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 800340ddefdfa18436abd2b38c5b0db1fcb84b1bb7b0d97984cf614ca17ad809
MD5 ebfb6120b8f30973a043e8be8df4becb
BLAKE2b-256 133ce4752bdd1aac91b022016b33d657da20311365a75f69e43f37fa97615e41

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