{"id":32175670,"url":"https://github.com/autodeployai/pypmml","last_synced_at":"2025-10-21T19:45:15.682Z","repository":{"id":60722594,"uuid":"190022101","full_name":"autodeployai/pypmml","owner":"autodeployai","description":"Python PMML scoring library","archived":false,"fork":false,"pushed_at":"2025-08-22T18:35:16.000Z","size":73894,"stargazers_count":78,"open_issues_count":8,"forks_count":22,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-08-22T21:08:18.008Z","etag":null,"topics":["pmml","pmml-deployment","pmml-evaluator","pmml-python","pmml-python-library","pmml-scoring-library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/autodeployai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-06-03T14:30:12.000Z","updated_at":"2025-08-22T18:34:03.000Z","dependencies_parsed_at":"2024-09-06T07:12:24.123Z","dependency_job_id":"a3dbd2c5-3dc4-4903-84e5-055bc4e9af15","html_url":"https://github.com/autodeployai/pypmml","commit_stats":{"total_commits":56,"total_committers":4,"mean_commits":14.0,"dds":0.1071428571428571,"last_synced_commit":"a028a44bcb43afe8945c5234348ab0bdf110fe30"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/autodeployai/pypmml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodeployai%2Fpypmml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodeployai%2Fpypmml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodeployai%2Fpypmml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodeployai%2Fpypmml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autodeployai","download_url":"https://codeload.github.com/autodeployai/pypmml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autodeployai%2Fpypmml/sbom","scorecard":{"id":217205,"data":{"date":"2025-08-11","repo":{"name":"github.com/autodeployai/pypmml","commit":"ee2791ef2794d3708acab4ef3da3cdd2858bda45"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/python-publish.yml:16","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":3,"reason":"binaries present in source code","details":["Warn: binary detected: pypmml/jars/commons-lang3-3.15.0.jar:1","Warn: binary detected: pypmml/jars/commons-math3-3.6.1.jar:1","Warn: binary detected: pypmml/jars/commons-text-1.12.0.jar:1","Warn: binary detected: pypmml/jars/pmml4s_2.13-1.5.7.jar:1","Warn: binary detected: pypmml/jars/scala-library-2.13.14.jar:1","Warn: binary detected: pypmml/jars/scala-reflect-2.13.14.jar:1","Warn: binary detected: pypmml/jars/spray-json_2.13-1.3.6.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/autodeployai/pypmml/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/autodeployai/pypmml/python-publish.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:32","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:33","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:36","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/python-publish.yml:19"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T01:52:37.171Z","repository_id":60722594,"created_at":"2025-08-17T01:52:37.172Z","updated_at":"2025-08-17T01:52:37.172Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280325292,"owners_count":26311419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pmml","pmml-deployment","pmml-evaluator","pmml-python","pmml-python-library","pmml-scoring-library"],"created_at":"2025-10-21T19:45:14.763Z","updated_at":"2025-10-21T19:45:15.675Z","avatar_url":"https://github.com/autodeployai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyPMML\n\n_PyPMML_ is a Python PMML scoring library, it really is the Python API for [PMML4S](https://github.com/autodeployai/pmml4s).\n\n## Prerequisites\n - Java \u003e= 8\n - Python 2.7 or \u003e= 3.5\n\n## Dependencies\n  - [Py4J](https://www.py4j.org/)\n  - or\n  - [JPype](https://www.jpype.org/)\n\n## Installation\n\n```bash\npip install pypmml\n```\n\nOr install the latest version from github:\n\n```bash\npip install --upgrade git+https://github.com/autodeployai/pypmml.git\n```\n\n## Usage\n1. Load model from various sources, e.g. readable, file path, string, or an array of bytes.\n\n    ```python\n    from pypmml import Model\n    \n    # The model is from http://dmg.org/pmml/pmml_examples/KNIME_PMML_4.1_Examples/single_iris_dectree.xml\n    model = Model.load('single_iris_dectree.xml')\n    ```\n\n2. Call `predict(data)` to predict new values that can be in different types, e.g. dict, list, json, ndarray of NumPy, Series or DataFrame of Pandas.\n\n    * **`data` in dict:**\n\n    ```python\n    \u003e\u003e\u003e model.predict({'sepal_length': 5.1, 'sepal_width': 3.5, 'petal_length': 1.4, 'petal_width': 0.2})\n    {'probability_Iris-setosa': 1.0, 'probability_Iris-versicolor': 0.0, 'probability': 1.0, 'predicted_class': 'Iris-setosa', 'probability_Iris-virginica': 0.0, 'node_id': '1'}\n    ```\n\n    * **`data` in list:** \n    \n    NOTE: the order of values must match the input names, and the order of results always matches the output names.\n\n    ```python\n    \u003e\u003e\u003e model.inputNames\n    ['sepal_length', 'sepal_width', 'petal_length', 'petal_width']\n    \u003e\u003e\u003e model.predict([5.1, 3.5, 1.4, 0.2])\n    ['Iris-setosa', 1.0, 1.0, 0.0, 0.0, '1']\n    \u003e\u003e\u003e model.outputNames\n    ['predicted_class', 'probability', 'probability_Iris-setosa', 'probability_Iris-versicolor', 'probability_Iris-virginica', 'node_id']\n    ```\n    \n    * **`data` in `records` json:**\n\n    ```python\n    \u003e\u003e\u003e model.predict('[{\"sepal_length\": 5.1, \"sepal_width\": 3.5, \"petal_length\": 1.4, \"petal_width\": 0.2}]')\n    [{\"probability\":1.0,\"probability_Iris-versicolor\":0.0,\"probability_Iris-setosa\":1.0,\"probability_Iris-virginica\":0.0,\"predicted_class\":\"Iris-setosa\",\"node_id\":\"1\"}]\n    ```\n\n    * **`data` in `split` json:**\n \n    ```python\n    \u003e\u003e\u003e model.predict('{\"columns\": [\"sepal_length\", \"sepal_width\", \"petal_length\", \"petal_width\"], \"data\": [[5.1, 3.5, 1.4, 0.2]]}')\n    {\"columns\":[\"predicted_class\",\"probability\",\"probability_Iris-setosa\",\"probability_Iris-versicolor\",\"probability_Iris-virginica\",\"node_id\"],\"data\":[[\"Iris-setosa\",1.0,1.0,0.0,0.0,\"1\"]]}\n    ```\n\n    * **`data` in ndarray of NumPy:**\n\n    NOTE: as the list above, the order of ndarray values must match the input names, and the order of results always matches the output names.\n    ```python\n    \u003e\u003e\u003e import numpy as np\n    \u003e\u003e\u003e model.predict(np.array([5.1, 3.5, 1.4, 0.2]))\n    ['Iris-setosa', 1.0, 1.0, 0.0, 0.0, '1']\n    \u003e\u003e\u003e \n    \u003e\u003e\u003e model.predict(np.array([[5.1, 3.5, 1.4, 0.2], [7, 3.2, 4.7, 1.4]]))\n    [['Iris-setosa', 1.0, 1.0, 0.0, 0.0, '1'], ['Iris-versicolor', 0.9074074074074074, 0.0, 0.9074074074074074, 0.09259259259259259, '3']]\n    ```\n\n    * **`data` in Series of Pandas:**\n    \n    ```python\n    \u003e\u003e\u003e import pandas as pd\n    \u003e\u003e\u003e model.predict(pd.Series({'sepal_length': 5.1, 'sepal_width': 3.5, 'petal_length': 1.4, 'petal_width': 0.2}))\n    node_id                                  1\n    predicted_class                Iris-setosa\n    probability                              1\n    probability_Iris-setosa                  1\n    probability_Iris-versicolor              0\n    probability_Iris-virginica               0\n    Name: 0, dtype: object\n    ```\n\n    * **`data` in DataFrame of Pandas:**\n\n    ```python\n    \u003e\u003e\u003e import pandas as pd\n    \u003e\u003e\u003e data = pd.read_csv('Iris.csv') # The data is from here: http://dmg.org/pmml/pmml_examples/Iris.csv\n    \u003e\u003e\u003e model.predict(data)\n    node_id predicted_class  probability  probability_Iris-setosa  probability_Iris-versicolor  probability_Iris-virginica\n    0         1     Iris-setosa     1.000000                      1.0                     0.000000                    0.000000\n    1         1     Iris-setosa     1.000000                      1.0                     0.000000                    0.000000\n    2         1     Iris-setosa     1.000000                      1.0                     0.000000                    0.000000\n    3         1     Iris-setosa     1.000000                      1.0                     0.000000                    0.000000\n    4         1     Iris-setosa     1.000000                      1.0                     0.000000                    0.000000\n    ..      ...             ...          ...                      ...                          ...                         ...\n    145      10  Iris-virginica     0.978261                      0.0                     0.021739                    0.978261\n    146      10  Iris-virginica     0.978261                      0.0                     0.021739                    0.978261\n    147      10  Iris-virginica     0.978261                      0.0                     0.021739                    0.978261\n    148      10  Iris-virginica     0.978261                      0.0                     0.021739                    0.978261\n    149      10  Iris-virginica     0.978261                      0.0                     0.021739                    0.978261\n    ```\n## Support Java gateways\nPyPMML supports both backends access to Java from Python: \"py4j\" and \"jpype\", `Py4j` is used by default, you can call the following code to switch to `jpype` before loading models:\n```python\nfrom pypmml import PMMLContext\n\nPMMLContext.getOrCreate(gateway=\"jpype\")\n```\n\n## Use PMML in Scala or Java\nSee the [PMML4S](https://github.com/autodeployai/pmml4s) project. _PMML4S_ is a PMML scoring library for Scala. It provides both Scala and Java Evaluator API for PMML.\n\n## Use PMML in Spark\nSee the [PMML4S-Spark](https://github.com/autodeployai/pmml4s-spark) project. _PMML4S-Spark_ is a PMML scoring library for Spark as SparkML Transformer.\n\n## Use PMML in PySpark\nSee the [PyPMML-Spark](https://github.com/autodeployai/pypmml-spark) project. _PyPMML-Spark_ is a Python PMML scoring library for PySpark as SparkML Transformer, it really is the Python API for PMML4s-Spark.\n\n## Deploy PMML as REST API\nSee the [AI-Serving](https://github.com/autodeployai/ai-serving) project. _AI-Serving_ is serving AI/ML models in the open standard formats PMML and ONNX with both HTTP (REST API) and gRPC endpoints.\n\n## Support\nIf you have any questions about the _PyPMML_ library, please open issues on this repository.\n\nFeedback and contributions to the project, no matter what kind, are always very welcome. \n\n## License\n_PyPMML_ is licensed under [APL 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautodeployai%2Fpypmml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautodeployai%2Fpypmml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautodeployai%2Fpypmml/lists"}