{ "info": { "author": "Daniel Bok", "author_email": "daniel.bok@outlook.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3" ], "description": "Kantopark Python\n================\n\nThis package contains Kantopark's python utility functions. The functions and types inside make it easier to develop Python instances. \n\n## Installation\n\n```bash\npip install kantopy\n```\n\n## Usage\n\nA typical function is listed below.\n\n```python\nimport json\n\ndef my_func(event):\n payload = event.json\n # some operations with the payload later\n # ...\n return json.dumps(payload)\n```\n\nSince Kantopark's python function must always return a string or byte object (data transferred over the web are essentially byte data after all), it might be tedious to use `json.dumps(...)`.\n\nWith `kantopy`, here's how the above can be re-written\n\n```python\nfrom kantopy import Event, as_json\n\ndef my_func(event: Event): # notice the typings here\n payload = event.json # minimize misspelling with typings\n # some operations later\n # ...\n return as_json(payload)\n```\n\nIf you're returning a graph (matplotlib or plotly), here's how you can use it.\n\n```python\nfrom kantopy import Event, as_png\nfrom matplotlib.figure import Figure\nfrom matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas\n\ndef create_figure():\n fig = Figure()\n axis = fig.add_subplot(1, 1, 1)\n xs = range(100)\n ys = [x * 2 + 3 for x in xs]\n axis.plot(xs, ys) # just a straight line\n return fig\n\ndef my_func(event: Event):\n fig = create_figure()\n return as_png(fig) # this would return the output as a png image\n```\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/DanielBok/copulae", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "kantopy", "package_url": "https://pypi.org/project/kantopy/", "platform": "", "project_url": "https://pypi.org/project/kantopy/", "project_urls": { "Homepage": "https://github.com/DanielBok/copulae" }, "release_url": "https://pypi.org/project/kantopy/0.0.1/", "requires_dist": [ "flask (>=1)" ], "requires_python": ">=3.6", "summary": "Utility library for Kantopark's python instances", "version": "0.0.1" }, "last_serial": 5201690, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c04749d738b98bd70dfbf371e820fa46", "sha256": "159a063d376a3e75d0687984bb32cf0e49830e4c494dd1ae0a2503079ee94ab4" }, "downloads": -1, "filename": "kantopy-0.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "c04749d738b98bd70dfbf371e820fa46", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 2612, "upload_time": "2019-04-29T05:40:14", "url": "https://files.pythonhosted.org/packages/fd/8f/5a7c42e4803631ce21c0b7aec5701f0911fe7828f9aedb015db16ca88d94/kantopy-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d987c9b1628f94b4edd3afbc068a43c", "sha256": "677d158226ecc31832a630fa032a25eef70c65838a8436150b36c7c6743e80ce" }, "downloads": -1, "filename": "kantopy-0.0.1.tar.gz", "has_sig": true, "md5_digest": "1d987c9b1628f94b4edd3afbc068a43c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2644, "upload_time": "2019-04-29T05:40:30", "url": "https://files.pythonhosted.org/packages/b7/d9/82af28ce22f585b03d496817d915f2fea428b01e0097823a45ca9ed32bbc/kantopy-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c04749d738b98bd70dfbf371e820fa46", "sha256": "159a063d376a3e75d0687984bb32cf0e49830e4c494dd1ae0a2503079ee94ab4" }, "downloads": -1, "filename": "kantopy-0.0.1-py3-none-any.whl", "has_sig": true, "md5_digest": "c04749d738b98bd70dfbf371e820fa46", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 2612, "upload_time": "2019-04-29T05:40:14", "url": "https://files.pythonhosted.org/packages/fd/8f/5a7c42e4803631ce21c0b7aec5701f0911fe7828f9aedb015db16ca88d94/kantopy-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1d987c9b1628f94b4edd3afbc068a43c", "sha256": "677d158226ecc31832a630fa032a25eef70c65838a8436150b36c7c6743e80ce" }, "downloads": -1, "filename": "kantopy-0.0.1.tar.gz", "has_sig": true, "md5_digest": "1d987c9b1628f94b4edd3afbc068a43c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 2644, "upload_time": "2019-04-29T05:40:30", "url": "https://files.pythonhosted.org/packages/b7/d9/82af28ce22f585b03d496817d915f2fea428b01e0097823a45ca9ed32bbc/kantopy-0.0.1.tar.gz" } ] }