hana-ml
Python Machine Learning Client for SAP HANA
Decision gist · record as of 2026-08-14
Yes, if you have SAP HANA infrastructure and need to build ML models on large datasets without data movement. The package is actively maintained, supports modern Python versions, and offers low install friction. However, the SAP DEVELOPER LICENSE AGREEMENT is non-standard and requires review; one known vulnerability (PYSEC-2023-172) should be investigated before production use. Not suitable for standalone Python ML work or non-SAP environments.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires active SAP HANA instance with network access, valid credentials, and AFL__SYS_AFL_AFLPAL_EXECUTE role for PAL; APL version 1905 or higher for APL functionality.
- Low install friction with a pure-Python wheel.
- Active maintenance with a release 17 days ago.
License · maintenance · safety
SAP DEVELOPER LICENSE AGREEMENT (unclear) — Licensed under SAP DEVELOPER LICENSE AGREEMENT (not an SPDX standard license). License treatment is unclear; review the full license terms before use in production or commercial contexts to confirm compliance with your intended use.
last release 2026-07-28 (17 days) · last repo commit 2026-08-07 · 114 stars
1 known vulnerabilities (OSV.dev, 2026-08-14) · 125,519 downloads/mo, #11,810 on PyPI
Alternatives
Verify before relying
pip install hana-ml
from hana_ml import dataframe
conn = dataframe.ConnectionContext(address="", port=, user="", password="")
df = conn.table('MY_TABLE', schema='MY_SCHEMA')
df_result = df.collect()- Exact scope and restrictions of SAP DEVELOPER LICENSE AGREEMENT for commercial or non-SAP environments
- Details of PYSEC-2023-172 vulnerability and whether it affects current version 2.29.26072700
- Whether PAL and APL require separate licensing or are included with SAP HANA subscription
What it is and what it does
hana-ml is a Python client that bridges data scientists to SAP HANA's in-database machine learning capabilities. It provides a SAP HANA DataFrame abstraction for querying and filtering data without pulling it to the client, plus APIs to PAL (Predictive Analysis Library) and APL (Automated Predictive Library) for training and scoring models directly in the database. The package also includes visualization tools (EDA plots, model reports, Shapley-value explanations), model persistence (save/load/delete in HANA tables), text mining, and spatial/graph analytics.
The package depends on hdbcli for database connectivity and uses pandas, numpy, plotly, and shapely for data manipulation and visualization. It requires an active SAP HANA instance with appropriate security roles and APL version 1905 or higher for full functionality. Typical workflow involves establishing a connection, creating a HANA DataFrame from a table or SQL query, training a model, and predicting on new data—all with computation happening server-side.
Use it for
- Build classification or regression models on large HANA tables without exporting data to Python for training.
- Perform exploratory data analysis on HANA data with built-in visualization and reporting functions.
- Train and persist machine learning models directly in HANA for low-latency inference in production.
- Analyze text documents stored in HANA using text mining functions like tf_analysis and text classification.
- Develop geospatial or graph-based analytics on data modeled as spatial or network structures in HANA.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you have SAP HANA infrastructure and need to build ML models on large datasets without data movement.
The package is actively maintained, supports modern Python versions, and offers low install friction. However, the SAP DEVELOPER LICENSE AGREEMENT is non-standard and requires review; one known vulnerability (PYSEC-2023-172) should be investigated before production use. Not suitable for standalone Python ML work or non-SAP environments.
Install
hana-ml on PyPI
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a release 17 days ago. Requires SAP HANA server access and appropriate PAL/APL roles; the package itself installs cleanly but is useless without a running HANA instance and proper database permissions.
Requires active SAP HANA instance with network access, valid credentials, and AFL__SYS_AFL_AFLPAL_EXECUTE role for PAL; APL version 1905 or higher for APL functionality.
License in practice
Licensed under SAP DEVELOPER LICENSE AGREEMENT (not an SPDX standard license). License treatment is unclear; review the full license terms before use in production or commercial contexts to confirm compliance with your intended use.
Quickstart
pip install hana-ml
from hana_ml import dataframe
conn = dataframe.ConnectionContext(address="", port=, user="", password="")
df = conn.table('MY_TABLE', schema='MY_SCHEMA')
df_result = df.collect()
Verify before relying
- Exact scope and restrictions of SAP DEVELOPER LICENSE AGREEMENT for commercial or non-SAP environments
- Details of PYSEC-2023-172 vulnerability and whether it affects current version 2.29.26072700
- Whether PAL and APL require separate licensing or are included with SAP HANA subscription
Package facts
| License | SAP DEVELOPER LICENSE AGREEMENT unclear |
| Python support | Supports the current Python release >=3.4 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 11 packageshdbclipydotplusDeprecatedtqdmscheduleprettytableshapelyplotlynumpypandasjinja2 |
| Maintenance | Actively maintained 17 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 125,519 / month, #11,810 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | 1 PYSEC-2023-172 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: MicrosoftOperating System :: Other OSProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: hana_ml-2.29.26072700-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “SAP HANA machine learning”
- hana-mlConnects Python to SAP HANA to build machine learning models and…
- sqlalchemy-hanaProvides a SQLAlchemy dialect that enables you to use SAP HANA as a…
- hdbcliA PEP 249-compliant Python database driver for connecting to and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also hdbcli · sqlalchemy-hana · azure-mgmt-hanaonazure · pyhdb · sap-ai-sdk-gen · sap-ai-sdk-core · ai-api-client-sdk · sap-ai-sdk-base · generative-ai-hub-sdk · pyodata