--- id: hana-ml version: "2.29.26072700" license: SAP DEVELOPER LICENSE AGREEMENT license_treatment: unclear maintenance: active --- # hana-ml — Python Machine Learning Client for SAP HANA License: unclear · Maintenance: active · Downloads: 125.5K/mo ## 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 above — verify before relying. Connects Python to SAP HANA to build machine learning models and query data directly in the database using PAL and APL algorithms without moving data to the client. 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 pip install hana-ml uv add hana-ml poetry add hana-ml ## Installing hana-ml 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. 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() 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. 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_current - Install friction: low - Maintenance: active - Downloads: 125.5K/month (top 15,000 on PyPI) - Known vulnerabilities: 1 ## Tags SAP HANA machine learning, HANA database Python client, in-database ML models, PAL APL algorithms, enterprise data science, HANA predictive analytics, database-native machine learning, sap-hana, in-database-ml, enterprise-analytics [View on SkillFed](https://skillfed.io/packages/hana-ml) · [View on PyPI](https://pypi.org/project/hana-ml/)