{"id":27280,"library":"pyhdb","title":"PyHDB - SAP HANA Database Client","description":"PyHDB is a pure Python client library for connecting to SAP HANA databases. It implements the SAP HANA database protocol (based on Python DB API 2.0) and supports features like LOBs, geometry types, procedures with resultsets, and SELECT FOR UPDATE. The current version is 0.3.4, released in December 2016 with bug fixes. The project is in maintenance mode with no recent releases.","status":"maintenance","version":"0.3.4","language":"python","source_language":"en","source_url":"https://github.com/SAP/pyhdb","tags":["sap-hana","database","client","dbapi","hana"],"install":[{"cmd":"pip install pyhdb","lang":"bash","label":"Install"}],"dependencies":[{"reason":"Used for Python 2/3 compatibility","package":"six","optional":false}],"imports":[{"note":"The correct package is pyhdb, not sap or hana_client","wrong":"from sap import ...","symbol":"Connection","correct":"from pyhdb import Connection"}],"quickstart":{"code":"from pyhdb import Connection\n\nconnection = Connection(\n    host=os.environ.get('HANA_HOST', 'localhost'),\n    port=os.environ.get('HANA_PORT', 39013),\n    user=os.environ.get('HANA_USER', 'user'),\n    password=os.environ.get('HANA_PASSWORD', 'pass')\n)\nconnection.connect()\ncursor = connection.cursor()\ncursor.execute(\"SELECT 'Hello, World!' FROM DUMMY\")\nprint(cursor.fetchone())\nconnection.close()","lang":"python","description":"Connect to SAP HANA and run a simple query."},"warnings":[{"fix":"Switch to 'pip install hdbcli' and use 'from hdbcli import dbapi'.","message":"PyHDB is effectively in maintenance mode. The last release was in 2016. Consider using the official SAP HANA Python driver 'hdbcli' instead. SAP has provided hdbcli as the recommended client.","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Install or update 'six' to the latest version.","message":"PyHDB uses Python 2/3 compatibility via 'six'. On Python 3, ensure you have a recent enough version to avoid subtle encoding issues with strings.","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Verify the correct HANA port with your administrator. Common ports: 30015 (MDC), 39013 (tenant DB).","message":"The connection parameters 'host' and 'port' are required but often misconfigured. The default port for HANA (3xx10) is 39013, not the common 30015. Using wrong port will raise a timeout error.","severity":"gotcha","affected_versions":"all"},{"fix":"Use connection.connect() after creating the Connection object.","message":"In v0.3.2, the 'connect' function was renamed to 'connection'? Actually, check the README: the correct class is 'Connection' from 'pyhdb'. But there was a change in connection method signature. Ensure you use 'connect()' method on the Connection object, not 'open()'.","severity":"breaking","affected_versions":">=0.3.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install pyhdb'. If in a virtual environment, ensure it is activated.","cause":"PyHDB is not installed or installed in wrong environment.","error":"ImportError: No module named pyhdb"},{"fix":"Check host and port values. Use 'telnet <host> <port>' to verify connectivity. Ensure the HANA instance is running and listening.","cause":"The HANA host or port is incorrect, or the HANA instance is not reachable.","error":"pyhdb.exceptions.OperationalError: Connection refused"},{"fix":"Use 'from pyhdb import Connection' then 'conn = Connection(...).connect()'.","cause":"The 'connect' function is deprecated or not available; use Connection class with connect() method.","error":"AttributeError: module 'pyhdb' has no attribute 'connect'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}