Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
tom_slee
Product and Topic Expert
Product and Topic Expert
The main point of this blog post is simple: you can now (June 25 2019) install the official SAP HANA python driver using pip.
> pip install hdbcli
Collecting hdbcli
Downloading https://files.pythonhosted.org/packages/41/63/6471c62de291772971b2fdb2b9447e3b98937c658273bd48ec8548... (3.3MB)
100% |████████████████████████████████| 3.3MB 99kB/s
Installing collected packages: hdbcli
Successfully installed hdbcli-2.4.142

A few more details.

  • The driver is distributed under the terms of the SAP Developer License.

  • Some python users will know there is an existing open source pure-python driver pyhdb. The official driver uses a native (C++) library for the network protocol, which is shared with other HANA drivers and so supports the full HANA protocol specification, including such features as routing in multi-node HANA instances, client-side encryption, support for Active-Active, and more.

  • Documentation on how to use the driver is on the SAP Help site.

  • This first release of the driver is version 2.4.142, meaning it corresponds to the SAP HANA 2.0 SPS04 release (the 142 being a build number). The driver supports connections to SAP HANA databases from SAP HANA 1.0 SPS09 and later.


The usual way of using the driver is as follows:
from hdbcli import dbapi
conn = dbapi.connect(
address="<hostname>",
port=3<NN>13,
databaseName='<db>',
user="<username>",
password="<password>"
)

For alternatives, see this page.