{"id":21888401,"url":"https://github.com/hydrospheredata/hydro-serving-python","last_synced_at":"2025-04-15T10:21:12.603Z","repository":{"id":47557769,"uuid":"114650257","full_name":"Hydrospheredata/hydro-serving-python","owner":"Hydrospheredata","description":"Python runtime for the Hydrosphere.io project.","archived":false,"fork":false,"pushed_at":"2022-12-09T05:55:08.000Z","size":166,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-28T19:11:31.841Z","etag":null,"topics":["hydrosphere","python","python-runtime"],"latest_commit_sha":null,"homepage":"http://docs.hydrosphere.io","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/Hydrospheredata.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}},"created_at":"2017-12-18T14:25:31.000Z","updated_at":"2023-01-31T16:55:29.000Z","dependencies_parsed_at":"2023-01-25T17:00:19.777Z","dependency_job_id":null,"html_url":"https://github.com/Hydrospheredata/hydro-serving-python","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hydrospheredata%2Fhydro-serving-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hydrospheredata%2Fhydro-serving-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hydrospheredata%2Fhydro-serving-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hydrospheredata%2Fhydro-serving-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hydrospheredata","download_url":"https://codeload.github.com/Hydrospheredata/hydro-serving-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249048829,"owners_count":21204318,"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","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":["hydrosphere","python","python-runtime"],"created_at":"2024-11-28T11:15:26.045Z","updated_at":"2025-04-15T10:21:12.580Z","avatar_url":"https://github.com/Hydrospheredata.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hydro-serving-python\nPython runtime for [Hydrosphere Serving](https://github.com/Hydrospheredata/hydro-serving).\nProvides a GRPC API for Python scripts.\n\nSupported versions are: python-3.7 python-3.8 \n\n## Build commands\n- `make test`\n- `make python-${VERSION}` - build docker runtime with python:${VERSION}-alpine base image\n- `make clean` - clean repository from temp files\n\n## Usage\n\nThis runtime uses `src/func_main.py` script as an entry point.\nYou may create any arbitrary Python application within,\njust keep in mind that the entry point of your script has to be located in\n   `src/func_main.py`.\n \n\nExample of a `func_main.py`:\n\n```python\nimport pandas as pd\nfrom joblib import load\n\n# Load an ML model during runtime initialisation\nclf = load('/model/files/classification_model.joblib')\n\n# This function is called on each request\n# Input and output must comply with your model's signature \ndef predict(**kwargs):\n    # kwargs is a dict with Numpy arrays or scalars you've specified in a signature\n    x = pd.DataFrame.from_dict({\"request\": kwargs}).T\n    predicted = clf.predict(x)\n    return {\"income\": int(predicted)}\n```\n\nor if you wish to work with proto messages:\n```python\n    return {\"income\": TensorProto(int_val=[int(predicted)],\n                                  dtype=DT_INT32,\n                                  tensor_shape=TensorShapeProto())}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhydrospheredata%2Fhydro-serving-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhydrospheredata%2Fhydro-serving-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhydrospheredata%2Fhydro-serving-python/lists"}