######################
SAP HANA Python Client
######################
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 <https://www.python.org/dev/peps/pep-0249/>`_
Getting Started
---------------
Install via ``pip install hdbcli`` or install manually via the `HANA Client Install <https://help.sap.com/viewer/f1b440ded6144a54ada97ff95dac7adf/latest/en-US/39eca89d94ca464ca52385ad50fc7dea.html>`_
Quick Start
-----------
* For HANA Cloud databases, the port number is 443 and encryption is always enabled by default
* 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 <https://help.sap.com/viewer/f1b440ded6144a54ada97ff95dac7adf/latest/en-US/f3b8fabf34324302b123297cdbe710f0.html>`_ 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 <https://answers.sap.com/tags/73554900100700000996>`_ 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 <https://tools.hana.ondemand.com/developer-license.txt>`_.
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 <https://www.sap.com/about/agreements/product-use-and-support-terms.html?tag=agreements:product-use-support-terms/on-premise-software/software-use-rights>`_
Raw data
{
"_id": null,
"home_page": "https://www.sap.com/",
"name": "hdbcli",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "SAP HANA client in-memory database SQL cloud business application intelligent enterprise AI artificial intelligence analytics experience",
"author": "SAP SE",
"author_email": null,
"download_url": null,
"platform": null,
"description": "######################\nSAP HANA Python Client\n######################\n\nIntroduction\n------------\n\nThe 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.\n\nIn PEP 249, autocommit is turned off by default. In the SAP HANA Python driver, autocommit is turned on by default.\n\nFor information, see: `PEP 249 -- Python Database API Specification v2.0 <https://www.python.org/dev/peps/pep-0249/>`_\n\nGetting Started\n---------------\n\nInstall via ``pip install hdbcli`` or install manually via the `HANA Client Install <https://help.sap.com/viewer/f1b440ded6144a54ada97ff95dac7adf/latest/en-US/39eca89d94ca464ca52385ad50fc7dea.html>`_\n\nQuick Start\n-----------\n\n * For HANA Cloud databases, the port number is 443 and encryption is always enabled by default\n * For HANA tenant databases, use the port number 3**NN**13 (where **NN** is the SAP instance number - e.g. 30013).\n * For HANA system databases in a multitenant system, the port number is 3**NN**13.\n * For HANA single-tenant databases, the port number is 3**NN**15.\n\n::\n\n from hdbcli import dbapi\n conn = dbapi.connect(\n address=\"<hostname>\",\n port=3<NN>MM,\n user=\"<username>\",\n password=\"<password>\"\n )\n cursor = conn.cursor()\n\nExecute a single statement that does not return a result set:\n\n::\n\n cursor.execute(\"CREATE TABLE T1 (ID INTEGER PRIMARY KEY, C2 VARCHAR(255))\")\n cursor.close()\n\n\nUse 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:\n\n::\n\n sql = 'INSERT INTO T1 (ID, C2) VALUES (?, ?)'\n cursor = conn.cursor()\n cursor.execute(sql, (1, 'hello'))\n # returns True\n cursor.execute(sql, (2, 'hello again'))\n # returns True\n cursor.close()\n\nUse named parameter binding to insert values into the T1 table. The values are supplied as a Python dictionary, and this example uses variable names.\n\n::\n\n sql = 'INSERT INTO T1 (ID, C2) VALUES (:id, :c2)'\n cursor = conn.cursor()\n id = 3\n c2 = \"goodbye\"\n cursor.execute(sql, {\"id\": id, \"c2\": c2})\n # returns True\n cursor.close()\n\nLoop over the rows of the result set.\n\n::\n\n sql = 'SELECT * FROM T1'\n cursor = conn.cursor()\n cursor.execute(sql)\n for row in cursor:\n print(row)\n\nHelp\n----\n\nSee the `SAP HANA Client Interface Programming Reference <https://help.sap.com/viewer/f1b440ded6144a54ada97ff95dac7adf/latest/en-US/f3b8fabf34324302b123297cdbe710f0.html>`_ for details about developing with the SAP HANA Python Client.\n\nCommunity\n---------\n\nSAP Community provides a forum where you can ask and answer questions, and comment and vote on the questions of others and their answers.\n\nSee `SAP HANA Community Questions <https://answers.sap.com/tags/73554900100700000996>`_ for details.\n\nLimitations of 32-bit Windows driver\n------------------------------------\n\nThe maximum length of a LOB column for the 32-bit Python driver on Windows is 2147483647.\nThe maximum rowcount that can be returned for the 32-bit Python driver on Windows is 2147483647.\n\nLicense\n-------\n\nThe HANA Python Client is provided via the `SAP Developer License Agreement <https://tools.hana.ondemand.com/developer-license.txt>`_.\n\nBy using this software, you agree that the following text is incorporated into the terms of the Developer Agreement:\n\n If you are an existing SAP customer for On Premise software, your use of this current software is also covered by the\n terms of your software license agreement with SAP, including the Use Rights, the current version of which can be found at:\n `https://www.sap.com/about/agreements/product-use-and-support-terms.html?tag=agreements:product-use-support-terms/on-premise-software/software-use-rights <https://www.sap.com/about/agreements/product-use-and-support-terms.html?tag=agreements:product-use-support-terms/on-premise-software/software-use-rights>`_\n\n\n",
"bugtrack_url": null,
"license": "SAP DEVELOPER LICENSE AGREEMENT",
"summary": "SAP HANA Python Client",
"version": "2.23.24",
"project_urls": {
"Documentation": "https://help.sap.com/viewer/f1b440ded6144a54ada97ff95dac7adf/latest/en-US/f3b8fabf34324302b123297cdbe710f0.html",
"Homepage": "https://www.sap.com/"
},
"split_keywords": [
"sap",
"hana",
"client",
"in-memory",
"database",
"sql",
"cloud",
"business",
"application",
"intelligent",
"enterprise",
"ai",
"artificial",
"intelligence",
"analytics",
"experience"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "91840b0fbc42a317c43729830e89e5a87d44253625b1b6d0d69bf4a53019cbb0",
"md5": "cc62327179e44a4473bac1e278405c1e",
"sha256": "85c6dab1a17e69e0f5bdd756bb2d0fb49fe5fd9ebad8d4abc083be7d4adf12aa"
},
"downloads": -1,
"filename": "hdbcli-2.23.24-cp34-abi3-macosx_10_11_x86_64.whl",
"has_sig": false,
"md5_digest": "cc62327179e44a4473bac1e278405c1e",
"packagetype": "bdist_wheel",
"python_version": "cp34",
"requires_python": null,
"size": 5561236,
"upload_time": "2024-12-10T17:06:09",
"upload_time_iso_8601": "2024-12-10T17:06:09.125229Z",
"url": "https://files.pythonhosted.org/packages/91/84/0b0fbc42a317c43729830e89e5a87d44253625b1b6d0d69bf4a53019cbb0/hdbcli-2.23.24-cp34-abi3-macosx_10_11_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8bb594756b91cb4d203f992dcd811f121a5ab90b498963bcda30250c07f581cf",
"md5": "f44269d40bc2a813b676098446a4e227",
"sha256": "8d21fd843ac5272119d769903d46362d47931851abc9143027ce0d50b4d97443"
},
"downloads": -1,
"filename": "hdbcli-2.23.24-cp34-abi3-manylinux1_x86_64.whl",
"has_sig": false,
"md5_digest": "f44269d40bc2a813b676098446a4e227",
"packagetype": "bdist_wheel",
"python_version": "cp34",
"requires_python": null,
"size": 11266884,
"upload_time": "2024-12-10T17:06:12",
"upload_time_iso_8601": "2024-12-10T17:06:12.799622Z",
"url": "https://files.pythonhosted.org/packages/8b/b5/94756b91cb4d203f992dcd811f121a5ab90b498963bcda30250c07f581cf/hdbcli-2.23.24-cp34-abi3-manylinux1_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ad4c6eed95c0df6d3c1db87b02bcc538385418c3c39a1c2f9f279eed9cf5960e",
"md5": "e2109447782d32f7766e64fdc5db9969",
"sha256": "7ec2627a1ef396ae318db675e18de08a614c8a5dd3c052735e14c0d4fee2575e"
},
"downloads": -1,
"filename": "hdbcli-2.23.24-cp34-abi3-manylinux2014_ppc64le.whl",
"has_sig": false,
"md5_digest": "e2109447782d32f7766e64fdc5db9969",
"packagetype": "bdist_wheel",
"python_version": "cp34",
"requires_python": null,
"size": 11342921,
"upload_time": "2024-12-10T17:06:17",
"upload_time_iso_8601": "2024-12-10T17:06:17.189921Z",
"url": "https://files.pythonhosted.org/packages/ad/4c/6eed95c0df6d3c1db87b02bcc538385418c3c39a1c2f9f279eed9cf5960e/hdbcli-2.23.24-cp34-abi3-manylinux2014_ppc64le.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1e0317fa43ba73883c185c8312db01509ed599ef4e399f12089a5ea90d4f2794",
"md5": "0916c5803e1e4b3686eb8d970805d1a5",
"sha256": "7532264d19eab11eefae3b8c12e01c213172ca65255800ec5e9321a12c1023e7"
},
"downloads": -1,
"filename": "hdbcli-2.23.24-cp36-abi3-manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "0916c5803e1e4b3686eb8d970805d1a5",
"packagetype": "bdist_wheel",
"python_version": "cp36",
"requires_python": null,
"size": 11160632,
"upload_time": "2024-12-10T17:06:20",
"upload_time_iso_8601": "2024-12-10T17:06:20.859024Z",
"url": "https://files.pythonhosted.org/packages/1e/03/17fa43ba73883c185c8312db01509ed599ef4e399f12089a5ea90d4f2794/hdbcli-2.23.24-cp36-abi3-manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fd11b697b1b858a8af61500453ff3f48513cf8cbb0eff755640b7f2eab499020",
"md5": "ea74c3c4d588df8540631661c2795eed",
"sha256": "a8d85b1bae1b4f45f592c2b89b10830f5c137fd4cfcfb953228e03f4133e0cad"
},
"downloads": -1,
"filename": "hdbcli-2.23.24-cp36-abi3-win32.whl",
"has_sig": false,
"md5_digest": "ea74c3c4d588df8540631661c2795eed",
"packagetype": "bdist_wheel",
"python_version": "cp36",
"requires_python": null,
"size": 3613652,
"upload_time": "2024-12-10T17:06:24",
"upload_time_iso_8601": "2024-12-10T17:06:24.853715Z",
"url": "https://files.pythonhosted.org/packages/fd/11/b697b1b858a8af61500453ff3f48513cf8cbb0eff755640b7f2eab499020/hdbcli-2.23.24-cp36-abi3-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "000c68412a593f716e996ef048b911f2b17b5d7e452781551fbcf9cc09c76d70",
"md5": "e69658228b629018916a0b772be2ff14",
"sha256": "64d1af072e1df9e563d1406e73951f6910a340ce76ad064baa772f46d86870e2"
},
"downloads": -1,
"filename": "hdbcli-2.23.24-cp36-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "e69658228b629018916a0b772be2ff14",
"packagetype": "bdist_wheel",
"python_version": "cp36",
"requires_python": null,
"size": 3613657,
"upload_time": "2024-12-10T17:06:28",
"upload_time_iso_8601": "2024-12-10T17:06:28.916934Z",
"url": "https://files.pythonhosted.org/packages/00/0c/68412a593f716e996ef048b911f2b17b5d7e452781551fbcf9cc09c76d70/hdbcli-2.23.24-cp36-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9022c743fc44d61a647d484455034c4a65819b3e0bd81ebc71fa12bc2cfb53eb",
"md5": "1f947dd6a403bfc43d3695cf2c2c418a",
"sha256": "1ba59f989026c4fac435e6aa893f46d22cfbf058597cade104e54b41e269e9f6"
},
"downloads": -1,
"filename": "hdbcli-2.23.24-cp38-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "1f947dd6a403bfc43d3695cf2c2c418a",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": null,
"size": 5041996,
"upload_time": "2024-12-10T17:06:31",
"upload_time_iso_8601": "2024-12-10T17:06:31.493048Z",
"url": "https://files.pythonhosted.org/packages/90/22/c743fc44d61a647d484455034c4a65819b3e0bd81ebc71fa12bc2cfb53eb/hdbcli-2.23.24-cp38-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-10 17:06:09",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "hdbcli"
}