Runs a SQL command on SAP HANA Cloud using OAuth single sign on and returns a pandas or polars dataframe
Project description
Usage of the hana_cloud_interface package
This package provides a simple interface to connect to SAP HANA Cloud databases and execute SQL queries. Below are some examples of how to use the package.
example
the main function is very simple It takes a SQL command as a string and returns the data
import hana_cloud_interface as hci
sql_command = """
SELECT top 10
"data1"
"data2"
FROM "table1"
"""
data = hci.hana_sql(sql_command)
initialising settings
Before using the package, you need to initialize the settings by specifying the configuration file location, browser override (if needed), and the default data frame type for SQL query results.
config_file : Path to the configuration file (JSON format) containing OAuth credentials and other settings.
Browser_override : Optional parameter to specify a browser for OAuth authentication. If left empty, the default browser will be used. this needs to be the path to the executable for the browser
data_frame_type : Default data frame type for SQL query results. Options are 'pandas' or 'polars'. Default is 'pandas'.
hci.initialize_settings(config_file = 'location of configuration file', Browser_override = '', data_frame_type = 'pandas')
the configuration file is a .json file
{
"CLIENT_ID": "",
"CLIENT_SECRET": "",
"AUTH_URL": "",
"TOKEN_URL": "",
"protected_url": "",
"REDIRECT_URI": "",
"SCOPE": "",
"HC_prod_URL": ""
}
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hana_cloud_interface-0.1.7.tar.gz.
File metadata
- Download URL: hana_cloud_interface-0.1.7.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb18d80259429736c50c9d9d1b111073b47f8ee87f50ddcd24449186c5932353
|
|
| MD5 |
420ab3ed60c3280f1f7e4d5cc24c36ed
|
|
| BLAKE2b-256 |
2edbda5c83d8ed096beb55ebd559e2face4274fe169866584ef5d18983d5bda6
|
File details
Details for the file hana_cloud_interface-0.1.7-py3-none-any.whl.
File metadata
- Download URL: hana_cloud_interface-0.1.7-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95e054860f09fe757ad50779d8ab86cfeb982634d40b42fd82de3e3b68c5f62d
|
|
| MD5 |
03de70656a1e345666d63b4136e621da
|
|
| BLAKE2b-256 |
2ac931a1c9fde460dade910284cc3be4d02383528c7cb641f3a7310b0e3e9eff
|