{ "info": { "author": "Aditya Kelvianto Sidharta", "author_email": "aditya.sdrt@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License" ], "description": "# scikit-rest\n\n![logo](logo.png)\nAutomatically deploy your ML model as a REST API\n\nOften times, deploying your favorite Scikit-learn / XGBoost / Pytorch / Tensorflow model as a REST API might take a lot of time. There are a lot of boilerplate codes to be written. `scikit-rest` is a package designed to alleviate most of the pain points within this process.\n## Prerequisites\n\nThis package officially supports Python 3\n\n## Installing\n```\npip install scikit_rest\n```\n\n## Usage\nThe main function offered in this package is `serve`, with the following syntax:\n```\n serve(\n col_list: List[str],\n col_types: Dict[str, Union[List, type]],\n transform_fn: Callable,\n predict_fn: Union[Callable, sklearn.base.BaseEstimator],\n port: int,\n is_nullable: bool ,\n name: str,\n )\n```\n\n### col_list\n\nList of Column names, where the order of the values will dictate the order within the pandas DataFrame\n```\ncol_list = ['class', 'sex', 'age', 'embarked', 'date', 'is_englishman']\n```\n\n### col_types\n\nDictionary of Column Names and the type of the variable, used for input Validation. If the values\nof the dictionary is instead a list, We assume that any input for the variable can only be any of\n the ones listed within the list\n```\ncol_types = {\n 'class' : int,\n 'sex' : str,\n 'age' : float,\n 'embarked': ['C', 'S', 'Q'],\n 'date': datetime.datetime,\n 'is_englishman': bool\n}\n```\n \n \n### transform_fn\n\nFunction which convert the input dataframe into test dataframe, we can call model.predict upon to get the final result\n```\ndef transform_fn(input_df):\n df = input_df.copy()\n df['sex'] = df['sex'].apply(lambda x : transform_sex(x))\n df['embarked'] = df['embarked'].apply(lambda x : transform_embarked(x))\n df['date'] = df['date'].dt.year\n df = df.fillna(0.)\n return df\n```\n\n### predict_fn\nFunction which convert the test dataframe into result. If a ML model instance is passed in, we will instead try to call model.predict_proba / model.predict to get the result\n```\ndef predict_fn(input_df):\n df = input_df.copy()\n return model.predict(df).item()\n```\n\n### port\nPort Number where the REST API should be served upon\n\n### is_nullable\nWhether input API can be nullable\n\n### name\nName of the program\n\n\n## Example\nExample of Usage can be found at [example](example) folder\n\n\n## Contributing\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct,\n and the process for submitting pull requests to us.\n\n## Authors\n[Aditya Kelvianto Sidharta][https://adityasidharta.com]\n\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/AdityaSidharta/scikit_rest", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "scikit_rest", "package_url": "https://pypi.org/project/scikit_rest/", "platform": "", "project_url": "https://pypi.org/project/scikit_rest/", "project_urls": { "Homepage": "https://github.com/AdityaSidharta/scikit_rest" }, "release_url": "https://pypi.org/project/scikit_rest/0.1.1/", "requires_dist": [ "flask==0.12.2", "flask-restful", "numpy", "pandas", "python-dateutil", "scikit-learn" ], "requires_python": "", "summary": "Automatically serve ML model as a REST API", "version": "0.1.1" }, "last_serial": 5198946, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "f2e8e67de63fcf0295c7cfac7ce36c66", "sha256": "6e373a483e6463539314c8b97e8555b1fe8b6013b0619612aeb618d5ba46aab7" }, "downloads": -1, "filename": "scikit_rest-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f2e8e67de63fcf0295c7cfac7ce36c66", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6807, "upload_time": "2019-04-27T15:06:11", "url": "https://files.pythonhosted.org/packages/1c/0e/6a3b1661d54ef14c8becbcbfb3250d5ea5e3e72621a1584f22369b2ba1e5/scikit_rest-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2f5256bfd65fe418b26f5c428bd56f57", "sha256": "3dec6ec065deea467f6c3f35ec1ad769309d0b7c6b60d2993f4ab324d84ac0f6" }, "downloads": -1, "filename": "scikit_rest-0.0.1.tar.gz", "has_sig": false, "md5_digest": "2f5256bfd65fe418b26f5c428bd56f57", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8776, "upload_time": "2019-04-27T15:06:44", "url": "https://files.pythonhosted.org/packages/4f/2f/fe02d9ffaf0237a5cbb2a973460eb0cbf132e76106de00e5d8f15a25a6a4/scikit_rest-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "778d8d21be5b46727ef3d169b2c4bbf1", "sha256": "87191fdcc870c1ecab33f7989f2d9492b0dfeb70d1f4372d636ae5105fcf2678" }, "downloads": -1, "filename": "scikit_rest-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "778d8d21be5b46727ef3d169b2c4bbf1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6812, "upload_time": "2019-04-27T15:09:06", "url": "https://files.pythonhosted.org/packages/be/7a/5ab33b805b5d04971f3223a36883627347bfebea54f12b043784cc31840f/scikit_rest-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "455ae8cce279fd679711a385314bf69b", "sha256": "af5a67368c0a198b3e92cc79520f7a4624d1ea9f20f897de15f2cc6815af31fd" }, "downloads": -1, "filename": "scikit_rest-0.0.2.tar.gz", "has_sig": false, "md5_digest": "455ae8cce279fd679711a385314bf69b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3627, "upload_time": "2019-04-27T15:09:15", "url": "https://files.pythonhosted.org/packages/4c/44/a1afb0283a62108a494c058a42d2f318e2262c0682b9b4e2f1cffa0481ff/scikit_rest-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "f949b4ef47c46e3d7406c9de48efa6b5", "sha256": "9aba62ea36631d340d7fcc01f64748829c69658469d55d6d2b00561cf51352d9" }, "downloads": -1, "filename": "scikit_rest-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f949b4ef47c46e3d7406c9de48efa6b5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8226, "upload_time": "2019-04-27T16:07:50", "url": "https://files.pythonhosted.org/packages/d4/c5/8642431f44a7c7ec15b95e2d6d31f0d12aa71fc60758877de8ce193b8b4c/scikit_rest-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d5ca12076c6d9d49b0065c1ecfcaea9a", "sha256": "3b85a29ac842f5a98bdea7298a61b0c79826948541a66e5b356536cd0e3b6759" }, "downloads": -1, "filename": "scikit_rest-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d5ca12076c6d9d49b0065c1ecfcaea9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4701, "upload_time": "2019-04-27T16:07:56", "url": "https://files.pythonhosted.org/packages/b4/74/2b1d3a4d927927960a69878cd802f0764db2ec188e1b3da924261162d7e6/scikit_rest-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "b089fca51bb903220e42a1549910ecb9", "sha256": "e61eec09fcb6e124d0890ffaa3173ab578979feac37688b1ee4201b15e258e1a" }, "downloads": -1, "filename": "scikit_rest-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b089fca51bb903220e42a1549910ecb9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14461, "upload_time": "2019-04-28T08:36:46", "url": "https://files.pythonhosted.org/packages/c4/5f/f81d2750a6c969da12d2a7b6f54f2fd89bb2c497717473333c3c61b187e2/scikit_rest-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ab3f94504a459272930d96ff864a530", "sha256": "0855814cbcf827cdc66f3ff9b3905d51fba2c04cfa41ff04b9f2efa51b5e0840" }, "downloads": -1, "filename": "scikit_rest-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6ab3f94504a459272930d96ff864a530", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28754, "upload_time": "2019-04-28T08:36:51", "url": "https://files.pythonhosted.org/packages/a6/22/06a60b2ab588dadeebaf198dce565c31ee7cfe078e2d75d354fad47e61ef/scikit_rest-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b089fca51bb903220e42a1549910ecb9", "sha256": "e61eec09fcb6e124d0890ffaa3173ab578979feac37688b1ee4201b15e258e1a" }, "downloads": -1, "filename": "scikit_rest-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b089fca51bb903220e42a1549910ecb9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14461, "upload_time": "2019-04-28T08:36:46", "url": "https://files.pythonhosted.org/packages/c4/5f/f81d2750a6c969da12d2a7b6f54f2fd89bb2c497717473333c3c61b187e2/scikit_rest-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6ab3f94504a459272930d96ff864a530", "sha256": "0855814cbcf827cdc66f3ff9b3905d51fba2c04cfa41ff04b9f2efa51b5e0840" }, "downloads": -1, "filename": "scikit_rest-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6ab3f94504a459272930d96ff864a530", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28754, "upload_time": "2019-04-28T08:36:51", "url": "https://files.pythonhosted.org/packages/a6/22/06a60b2ab588dadeebaf198dce565c31ee7cfe078e2d75d354fad47e61ef/scikit_rest-0.1.1.tar.gz" } ] }