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

Uploaded CPython 3.8mWindows x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.4mWindows x86-64

hdbcli-2.5.111-cp34-abi3-manylinux2014_ppc64le.whl (10.6 MB view details)

Uploaded CPython 3.4+

hdbcli-2.5.111-cp34-abi3-manylinux1_x86_64.whl (22.6 MB view details)

Uploaded CPython 3.4+

hdbcli-2.5.111-cp34-abi3-macosx_10_7_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.4+macOS 10.7+ x86-64

hdbcli-2.5.111-cp27-cp27mu-manylinux2014_ppc64le.whl (10.6 MB view details)

Uploaded CPython 2.7mu

hdbcli-2.5.111-cp27-cp27mu-manylinux1_x86_64.whl (22.6 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mumacOS 10.7+ x86-64

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

Uploaded CPython 2.7mWindows x86-64

hdbcli-2.5.111-cp27-cp27m-manylinux2014_ppc64le.whl (10.6 MB view details)

Uploaded CPython 2.7m

hdbcli-2.5.111-cp27-cp27m-manylinux1_x86_64.whl (22.6 MB view details)

Uploaded CPython 2.7m

hdbcli-2.5.111-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.5.111-cp38-cp38m-win_amd64.whl.

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 e084b0bfd793bee64697b8f12298e78d93beddf2270174f82072dc3fb8bb1209
MD5 b2ed3d2e5d7a906c194e975bd6710573
BLAKE2b-256 0d87de548bd8c03f234bda743eeca142125f9ea97bd6638f34db7e6660297471

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 48af634de6c94fda4e0be07f134323bc4519981b347ba8883c6497d966b64896
MD5 d1899088faac0b8f22c58aa5385b4a97
BLAKE2b-256 bded34adb444fc1350ebd57867055b18a2c011dec7e73fbe4a6a69306bdff1d8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 bd603ca5e2d3ecaac71c35d1064d3916330af8b97827f6d7e9a3f8e5894fd1d4
MD5 16b0f8f57825500d2f8d35bb56fb478f
BLAKE2b-256 0dd14bd16ffb198989d6c286f864ee7420277e0aaa27a4ebbe74a2c1973ce225

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 7bb5f2c670bd4d8bbb7c736aa32192bb9bca32e9b2e6a2c72b51bea0b84755c4
MD5 05627e8dc0b9769ab6fe046075ff3b0b
BLAKE2b-256 6b89e2f5ae27422920f329556d86d7343e576205d0d91c9a282bc4b427d31eff

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 f4a95bbd9589d27ddbe6d0327cdf858a3a931ce632b4c79bbaa5ee810a2609ae
MD5 6e6a94235fbb13ccde36e64db314eb6a
BLAKE2b-256 056098521a78789b7309dd934579679dc0e79c1047e8d9a8e582942c8c734e07

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 e2d9089678b192a290ebfa4e6feb7313ae4a717f719996ea9a9ce1ffaa799c91
MD5 da5676527c19db52f8ae39fed9570e3e
BLAKE2b-256 0933acf1782a118a0e9429af190f304ad73b76d50cc53b6c18cb3a658e17bfa8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 61c665bb772e16a4e868c27074b2f3ee099b01a25d20eec28d5e14b1c22be755
MD5 924552fcc569074188935b9adbd4cb7b
BLAKE2b-256 33a5da218af5f222e8d707a82f8c7821d30fcfcbc14a5e28408369216c3c49d5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4147e96b996e7b92a6b1124ab22e10d94704fae2203c4f5f522ccdc215807335
MD5 8fca673b49fe9b6d0c6b0bdb1616ac7b
BLAKE2b-256 bd39d9d6eba02ca401aa015519690fbaed927c08804339f470ba74388ae96387

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a9e7bdf35a018c7c7a477623815213e522d56417136e37f6e303d1c62da28d3d
MD5 7308eca526f77a53080b2fe3cbcfd561
BLAKE2b-256 e2bcdab88dd53617b5a5773713c9e0859f14f1432fd57a8627dd40c4ffff54a2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 67bcc55d5eab98b83f6e65d6bd901ff9c328bf362173f3bbc624cc77afcd2c10
MD5 a6a160849e8c25c52b254191e6537e6a
BLAKE2b-256 e020893eebf07d1dc27cb34044c947fec7372d7d372fe0a9d5570b97024a7043

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 897d21533de2357af592a5e675692de7f918855db8f13b880db214e56c823b42
MD5 c43c4cc1fdc2bdceed7469260316d2bd
BLAKE2b-256 4ec9e18aac3f9735dd0be786ea4c2f2cd5ffc1894f399dea2ada648deec55e54

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 e8aea2c3b74ea7fb240c49869472ead59b6f99f49161fce75f5472e199a51f82
MD5 b25719f1dc52ecd81b64b92eb787eec9
BLAKE2b-256 d9071f68e61616558c3b78e66a6912fcb16010a39651ea707481b90f5a9fd758

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 9c0a237bc8ea3385412e4f9948ae01aa6a9f0ce84f867bca5fbcf6ac01c7a32d
MD5 1c372cad42c7a82b2023364948ff59f4
BLAKE2b-256 b52452078b0cc3469e27c70917b758912d2bb478674492326941e0c64427f861

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 dde11a6c0b48f9fe202da61319dd8a80513d3a9f93dfb1549c5250fc7a0874f8
MD5 39ab9f78cf471243dff9657af2aed36a
BLAKE2b-256 557c935b3325ee05f3fe17237ab442644913370f1bb564f19542dbf655560d89

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 49f5c894ca8fd9572c1d25c428a8625872a42b817b22409aeead9d8c0fcc996c
MD5 ed8e0b692d6f44f967d2d59833618619
BLAKE2b-256 4821cc7a7d9a9b4792a0a80482e398d1c79dcfbedd31470c22befec60083e339

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.5.111-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 48d1dde195b1efe9a3f08bb7e3b7cc2e47ccaaea5a1b7a99f8d450842f2147c2
MD5 cfd8d1ca54022103b4086465572c76fd
BLAKE2b-256 b7960604c85ece75aa9c30c60a488f6c511d1b4fb98167260318bc305349d827

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