In order to work with HANA in python, I've always used the pretty old python 2.6.4 that came with the HANA client. There are ways to get it working with other python versions, too, but they seem to by very hacky.
Now I've found the very promising-looking PyHDB project on Github, which seems to do the same job being installed more easy and working with newer Python versions, too.
Which features won't work with PyHDB that worked with the HANA python?
Are there performance drawbacks?
Edit:
Here is what I found using the module globals:
format
; hdbcli: qmark, named
)Description. A pure Python client for the SAP HANA Database based on the SAP HANA Database SQL Command Network Protocol. pyhdb supports Python 2.7, 3.3, 3.4, 3.5, 3.6 and also PyPy on Linux, OSX and Windows. It implements a large part of the DBAPI Specification v2. 0 (PEP 249).
Confirm you have a supported python version (2.7, or 3.4+) by typing the following at a command prompt to show the python version: python -V.
Here an update on the current situation:
Regarding performance:
The following blog post contains some further information:
https://blogs.sap.com/2017/07/26/sap-hana-2.0-sps02-new-feature-updated-python-driver/
The PyHDB is the younger brother of the node-hdb, both implementing the same protocol as ODBC based Python package hdbcli. The hdbcli Python client is a part of standard HANA installation but it does not belong to the list of officially supported interfaces for building HANA applications, to my knowledge. The orientation for building PyHDB was therefore not the hdbcli client but the above mentioned protocol specification and the existing node-hdb implementation.
The detailed hdbcli/PyHDB cross-comparison is therefore not currently available but looking into the protocol specification and READMEs of PyHDB and node-hdb helps getting insight into connectors' features and the current coverage of the specification by both implementations.
Among these three HANA connectors, hdbcli, node-hdb and PyHDB, the PyHDB, being the youngest one, offers atm. the least features and capabilities, missing some features already available in node-hdb, like authentication methods or prepared statements for example. Looking into node-hdb source helps getting the rough estimate of efforts required for building the same in Python.
Rather than waiting for the full coverage of the protocol, which could take a while, the PyHDB is released "as is", but open for receiving input and requirements from projects and offering new features in that direction.
No performance drawbacks discovered so far.
Perhaps worth of mentioning here, the direct connectivity from Python and nodejs (GO should come soon) is also possible with ABAP, via SAP RFC protocol, via PyRFC and node-rfc connectors, which are counterparts of standard ABAP RFC connectors, available for Java and .NET as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With