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.

Limitations of 32-bit Windows driver

The maximum length of a LOB column for the 32-bit Python driver on Windows is 2147483647. The maximum rowcount that can be returned for the 32-bit Python driver on Windows is 2147483647.

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.7.16-cp39-cp39-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.8mWindows x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.5mWindows x86-64

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

Uploaded CPython 3.4mWindows x86-64

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

Uploaded CPython 3.4+

hdbcli-2.7.16-cp34-abi3-manylinux1_x86_64.whl (11.7 MB view details)

Uploaded CPython 3.4+

hdbcli-2.7.16-cp34-abi3-macosx_10_7_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.4+macOS 10.7+ x86-64

hdbcli-2.7.16-cp27-cp27mu-manylinux2014_ppc64le.whl (11.2 MB view details)

Uploaded CPython 2.7mu

hdbcli-2.7.16-cp27-cp27mu-manylinux1_x86_64.whl (11.7 MB view details)

Uploaded CPython 2.7mu

hdbcli-2.7.16-cp27-cp27mu-macosx_10_7_x86_64.whl (5.7 MB view details)

Uploaded CPython 2.7mumacOS 10.7+ x86-64

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

Uploaded CPython 2.7mWindows x86-64

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

Uploaded CPython 2.7m

hdbcli-2.7.16-cp27-cp27m-manylinux1_x86_64.whl (11.7 MB view details)

Uploaded CPython 2.7m

hdbcli-2.7.16-cp27-cp27m-macosx_10_7_x86_64.whl (5.7 MB view details)

Uploaded CPython 2.7mmacOS 10.7+ x86-64

File details

Details for the file hdbcli-2.7.16-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: hdbcli-2.7.16-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 cde6da13b3beb0bdb7484029218c3772d9804593ff6d6a28a5e2ea2e390edd2d
MD5 3142da5dc5b453ca43a9672128b380cb
BLAKE2b-256 169c404f29ac6fef00e49359e654385a6fb9657a9624c7f74939982b5e898557

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp38-cp38m-win_amd64.whl
Algorithm Hash digest
SHA256 99a9929d256cefe69740160e081981469a21177e35b067573de1e11382191b5f
MD5 8ecfca8e2b047d934ab1bf34ce23dcaa
BLAKE2b-256 af6a2a8c42fbf44215c5b02fe227e0c3731908f361ed6bfc70df6c1cdc76c6b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ebcf1056c05a843200a67526eb524827456f77bd5241a0ba5115e265f92f2653
MD5 096e9c9f71ef429f306f5069036386df
BLAKE2b-256 b4a2e07f65f4427cb4ef27ee8490a73f572b409c42692ac453f54cd93e1c0f83

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 5004f2d9259b30eec0524412ceffe54aded038a5540c03fea828dd80f95c8640
MD5 e7971442502ca6b271e1feb09a04da5a
BLAKE2b-256 f1746861d7a34b9c0492438b01bc990c6901f65c84cfd4c53073189d7c35873e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 0bf1165dc19521fd05c342f55d62d76cf310036fb847fbfc499d313e51b2a354
MD5 d38f4d470aa5d87e687182701836d6d1
BLAKE2b-256 eca344ef0d51d0fbfbf1d6cb2e5e3dfcfc54e1eff548300e2823d7dc63d6f862

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 915d7d1fc57893f47b95134227e746dff59a4ceb136b8e100a0595bb54947f39
MD5 f7d579d0a9acf5f9b78782e1c0676f20
BLAKE2b-256 382c8927e72f31b50556392646acabf7fba8045ee38cfb63dde62efd8ec71c44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 e6cbc89466acf51325d27c98d757e49744ce2e2559e54d416ba36b844961f84b
MD5 8344f725bad2acf354063d65d3743957
BLAKE2b-256 b18988b8a5b44664f79f4429c311deafbe79d33db8c30304495003b982567a74

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp34-abi3-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 da534f646f223b29886129c04c4c12677ca2e4ba77556f358d2c7c2b12ca874c
MD5 d92821ddca4e0b42a77e7d77347fad15
BLAKE2b-256 63de4c6c72948ac2b3848120a10c349317c66041e9d6d418c2cae75e8784c2c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-cp34-abi3-manylinux1_x86_64.whl
  • Upload date:
  • Size: 11.7 MB
  • Tags: CPython 3.4+
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp34-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ce98a22fe4e0749fdd73d363766558ee26e3bb004f69bd72090e5708c8855aca
MD5 3bb53a4ceb1a3e1d8deaf7fd261994dd
BLAKE2b-256 2247419ec0bd0eb01e2d54b6d8fad3d7b1a591c94d594783ccb3653f75b13001

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-cp34-abi3-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 5.7 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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp34-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 84b10e0203639a3a4a72b3473aae7e10efa2370913d7e305190aec9649ec00d9
MD5 15a61f06943f5edd86f8095d3a7a642a
BLAKE2b-256 dda26ac3df5d0cd96ba819b6a014dd46c4cb6c7e9e5e06df290434dd013e5682

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp27-cp27mu-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 2068fa02e0d3d7aba65551d14b0d7a66969a314400f9a62ad2afb06cce6a6a2a
MD5 2164032eced661cb366c695eb094f0e1
BLAKE2b-256 0c04c4d710e2bf0a52cccde6ad63edfbfa53fe6aff200c395778bda915f49047

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 11.7 MB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 eb95bd2c13cc89840bccdb650487f578b127de61e0a731debc5b0c0e58691bb1
MD5 8bd81eba4c83ed83f2caf0ac22f55a2c
BLAKE2b-256 1795d968ab041f66f61e6a843f98965a4f2a9d2fc22b203edb7aa64321430f84

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-cp27-cp27mu-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 5.7 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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp27-cp27mu-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 7de8d6d795bc4f4e55ae4697452c40b9e7ea5bb16356ea376683641a36409ed5
MD5 d89bd41486483e0148214b2e184dcaf0
BLAKE2b-256 8bceb20adcca144ce97e7572ecd22f3802e405b67c09376d64934c520fd4d38b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 d637f0030641d7663afa551bdabe537b7007ce4ade683da5304f96b57f4f6606
MD5 06ee69a5a4b812050de637ef6b3a7ea7
BLAKE2b-256 562662a6dce9abedad3feb73d2f5705fadfd44d5b2a606f73fff7b7e7b0e3ebc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp27-cp27m-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 49dbb0f8ff25a2a3a782087eb41e084975ce5206e3e72a321cd2d18da2159096
MD5 5d576dff476c986478fe8105d2e7f47c
BLAKE2b-256 ad255b648316262ee2ccd22fc1c21e17da5824abe85a0acd1326b99fa097cd63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 11.7 MB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 74ce93c8b70f31ed589f0b405ff59db5d146b10f09ccf8898d0d0ad0247f30e4
MD5 beb4d3cf11a14132d793283f43a0193c
BLAKE2b-256 7ac4800dca1ac05f36e9bc5c57473a1ee899b1f30b2b05b72bd86817334401f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdbcli-2.7.16-cp27-cp27m-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 5.7 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.25.1 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.5.3

File hashes

Hashes for hdbcli-2.7.16-cp27-cp27m-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 56574a2ffe8f8b7a4136eb7b682e62deb16f01010d63e18d8fe91ef2cabcf54c
MD5 71cfa41f6650dee9c1a5d780b8c68737
BLAKE2b-256 9d6decc11fc1eedbc68f0eb5628550406c82c8bc10c2d450834300263510cf42

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