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

Uploaded CPython 3.8m Windows x86-64

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.5m Windows x86-64

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

Uploaded CPython 3.4m Windows x86-64

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

Uploaded CPython 3.4+

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

Uploaded CPython 2.7mu

hdbcli-2.4.194-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.194-cp27-cp27m-win_amd64.whl (3.3 MB view details)

Uploaded CPython 2.7m Windows x86-64

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

Uploaded CPython 2.7m

hdbcli-2.4.194-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.194-cp38-cp38m-win_amd64.whl.

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 8b3468ff7ece068113e02d4a8bc9784c2069484f246361a765bda4a7fc8aec62
MD5 03a1eb445c22ca13a578ff706d98aaad
BLAKE2b-256 2170546ef7927272baf84e5f32eae042a2966abec2e218aae9175beb242c9abe

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6951bc10910aaefd77a577bccecf077e59c08bc86a07abf1c1819e0c9f5bbfd9
MD5 8fd22e78a1b33ff10dea13c44e40372e
BLAKE2b-256 ee404aa5984ef85ffee3b92870add016978be63e9f8c8d84771670bc352ee15f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 49dcc59ed93645dfb3530c738ba34503e0407c118f00081712d45871a9ae2687
MD5 1694f1f937a0e3056c4a382e51fb03af
BLAKE2b-256 0ce4120c53864e98c096b8dcac66b2a4b4de287f0b868d639e558381cf18c27d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b560a69ce24fd046bdbb8d8dca54eec6f2b987207e3f7a925b6c5e8fd5031570
MD5 38daf0af4ece548578941879f0ff1995
BLAKE2b-256 32a54f758604c975729b707804b3872f3c8fd297f56d6916ed26660790160de6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 8a0ce404b56db256581571da20066094e3b4039ffcdc4a9f45b77026cdde6d16
MD5 6ac116628956e670115244f9afc5be50
BLAKE2b-256 8760acd08454b8da2af40b76b6c1a852710f8c3cd2157b5be9e5c9525a57f0c5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 59898235b9bb30e11a1bf74fd6207b61f9ef34fa5130806be9482156ebd2bb8b
MD5 75f170257c82ae4a36d5466826b3f040
BLAKE2b-256 a04ca173b6be552fc737c49ce187d73f3b02c695b8ba0d88bb37b4ed95f1d381

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 376992ee43517787bd08397410130ba2fd079d3e16fc6a51e8ed0fb5326168d4
MD5 2ed9a9248f6aeb859a7e24bb46196816
BLAKE2b-256 4fc8ba4a397261fbdfafc572361876414d99bbe912f4574159e55f934ae7a84c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 ccb59827d8dcb4679968d73a533b033a501532e9c2c8305748c64912e9229b61
MD5 854553faa8b3e389061bba5d3879e4a4
BLAKE2b-256 e0902be3436079e4e9a5f2a87032710776c092fc6d0d85d614ebd191b94030e0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 baf4fc41789489f483508b193785e16101f33d6119c21e26d763fb4301554727
MD5 fe7d6a5487d679568e351387ab12394a
BLAKE2b-256 43517c0c23c7d8c48a6924d9a2d61d040180853575eb824a76af1178b34e71d1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 7d28d65065ad966ca23b50b4417a31376ba672e30fead9ad6f7ee54600e7dcb4
MD5 c4c188fcf6d939f8bf23462ab5cfcc4a
BLAKE2b-256 ebaaa1cf4bf428d9f0a97eb0a081cc21eedf6c18c2527065120b6d3df735d8cc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 ee131c9f8fbf1e99209ba120d8decef1e011763c0e243c0ead4aae2ce43e9603
MD5 0c1e39e5fe1b1c8f47648a0fe8ee8e76
BLAKE2b-256 ed6a6312aa0f0d30e5a7c90b9a8e899ba6108e86505d564060fc02e544a41b02

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 68fe4f386185c555f37c27ba36f737d64a12e8077fc600c3c7535e69e965cc00
MD5 2e57ac41e7d6b4c7ef1defba65c53f67
BLAKE2b-256 9c695c99b433f50e1e65532d678f07573aff93a034bc3710f0eab29211b18513

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hdbcli-2.4.194-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8fc285bae499e5b72a527b1fa7ed5fe93bec528b289d06254bc239476aa24161
MD5 dc8f7064aefe724f940177493290034a
BLAKE2b-256 fea6de17048f567a4c1414f51d35335b9508a426646f66d44f6a461c09775f16

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