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

Uploaded CPython 3.8mWindows x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4+

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

Uploaded CPython 3.4+

hdbcli-2.5.109-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.109-cp27-cp27mu-manylinux2014_ppc64le.whl (10.6 MB view details)

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mu

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

Uploaded CPython 2.7mumacOS 10.7+ x86-64

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7m

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

Uploaded CPython 2.7m

hdbcli-2.5.109-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.109-cp38-cp38m-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 1ad4e4e93963d63d2c6bb10f4d2954439eca59b30197805c0896230df90460db
MD5 edcff6695f40e6366bcf829841ed0ba2
BLAKE2b-256 5a480c51ad7167d24377e7d8dbfc1bff1e3c1e0ab3b9637d48e62a47fefa253c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d9836835ef7d3449f23b4ee0b90cd32bbbbfe6347df20b11405770a822aa423a
MD5 00cfc87c94c887f5b7d4c574b18fe3cd
BLAKE2b-256 439dd6e46632f6c15259c9e4ade495da2f320b571d6642d49879915c74f27dc6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c7fac69690f87cd26889db2869fee2a6e31daa21bebcf8ecb14d0b0c27c7d37c
MD5 b77a9fc7fa0b60a65d74954161a7e30e
BLAKE2b-256 9d2151b83db5777071639d77e8e0a28bdd1d7ba1dc2ae08f8984e5f5d532bb88

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 886898c7ca8f84be4879654c692d4cd4ab23ecfe10e4c5186eec7c48dcb16bfe
MD5 bf1d21d6fa35e75c1783b4131fec6629
BLAKE2b-256 37fb5b2457a556b778ba4df3d6c458c24fbde9b28da340f8bb7c81d612594093

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 0b8ed5a89026bc1721c35f715c8861e9658ad86022da12aae787157ea903fbcf
MD5 610ad1ee8415a612779cebe6266db71b
BLAKE2b-256 73c7d2d26a2e135c4d33e50e122a231278c009c0a1f48255e6552ddf8c4e0e34

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 d567023b8b0f951db1e2144c4ffce65a7c62c970ff61997c4219f3549c62e8e5
MD5 0f344da06ca790ba8ac324a80ee0c5a6
BLAKE2b-256 776715e038ba7b484317e7ea28beda51dd84746d6d28e6914556ec25ea4fa4f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 3ef8ec8acf68b00768d6a89600e4aca6c984fa29446abf552f93071eb8860b52
MD5 085f8eab24a8e2d5d2c9e2766a9c5587
BLAKE2b-256 0835c9c311c31428fe14be4c33f8aea130cd370d4606058ee9e6067a80f0a628

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4a78d7172dc676e4e1595b4be2ba9d13a1d71048c7387ac7fe6e7b3161f51c9a
MD5 c274fc18e3ed4317ee91786f51a16047
BLAKE2b-256 43401e7cecb12571b4877adfc720411fbb27aee3068d71857c937374cb94b228

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 d939bcac8a67a75b4b941a3471e7b3e934639c3385d816a29e1c4ba2fd7f1ab7
MD5 3e38f8b3eaa06851350ddd3ba541d835
BLAKE2b-256 4cbd5698e3de78389dad1e04c350a7211f290c86fb55f2d063b626199b516c2d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 3ee2248b34da0e43ea799675fbc3e512ec9f19578c0898dbb80a3da6a638f289
MD5 47ccab8fd969f8ef8252a511f31f73ac
BLAKE2b-256 6875f68bd06bcd55b9d9d728a589005e71b4fb8241843dcb3ba66187b48d79b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 900ceec1d315cb396186758ddee249954980fbe9e74bba217ceec08063612471
MD5 aea34ac7d7ed5696737933e25b70a858
BLAKE2b-256 2f0ff63723304decf1ac7d3eece2871176ecaf0703ab74bb0291d85ec5cf92fc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 c96f52d5c7188c9a2a6f5b28fc165da1508f490b89244d8644eab60c8a3ae45d
MD5 4a4114bf802b77e199cbd73b432d7a2f
BLAKE2b-256 76f188f8168499c49a5a77c805bf14029baad54ed911cbe6c94391f42a608a03

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 0b4c4a23f71775ef37d7c4073599b8d1ffb2be264c1d5dec8bd3a78550d23f0d
MD5 99630d0b27a2bfe34943aac408d26df7
BLAKE2b-256 14b9933dd8f8ff6036b9cae864fc880616252c69ee63ad7e6f51b3aa32bfd1bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 f2402509dbea320ac57c268a0b27dcf6167efd3e9524e288d8cc7f9f0b1ee1de
MD5 14a004db9df4545a4a20f2f7d391546d
BLAKE2b-256 17f180a089a60ba04f1b739ec891737e125ba8269cb4863f9763415ec8c8ee11

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 eabff3076bc4e72da76d64336fd2244bcdc3dc45e6c84600669deb8f3cfadbf9
MD5 abf1aac60d18425e8fa941fe02284807
BLAKE2b-256 31f387db740b3d0193b6e79386bf6976c445dba40ceb04b58386cd902612a1ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.5.109-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.109-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 ec3f034b15c6af2c692b50e96647fc0e3b559aa25b0ec3d7809d681d96ab4fbc
MD5 b8a4438aa2d50d7729de0c395c3ead9a
BLAKE2b-256 1bef9c28806d7bda43ec6698f72c710792ad0487122b8e4ea9e1b706b8f25a6b

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