{ "info": { "author": "Yaztown", "author_email": "yaztown@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools" ], "description": "# loopie\n\nThis python framework is to provide a skeleton for managing a looping mainthread, with the ability of spawning childern threads that either loop of just do any other code and exit.\n\nThe project is designed to create a commandline application to loop through a custom python code while creating a skeleton for each project similar to the Arduino sketch code; meaning, for a loop to run there should be a loop_setup routine and a loop_logic routine that will be called on every loop.\n\nOne of the main uses of this project is to create a startup script (systemd) on a Raspberry Pi 2/3 that will run your custom python application, for example, to interact with the GPIO pins from the very start of the Pi.\n\nTo interact with the mainloop, the framework features a built-in WSGI application (which is based on [Flask](https://palletsprojects.com/p/flask/)) and a [wsgiserver](https://gitlab.com/fgallaire/wsgiserver) which act as a simple UI for the mainloop at [http://localhost:8000/](http://localhost:8000/). In addition, a JSON RPC ([Flask-JSONRPC](https://pypi.org/project/Flask-JSONRPC/)) service is added to the WSGI app to enable creating JSON APIs for your service. By default, the url for the api service is preappend with [http://localhost:8000/api/](http://localhost:8000/api/) and include a browsable api page found here [http://localhost:8000/api/browse/](http://localhost:8000/api/browse/).\n\nThis web server is enabled by default but can be disabled. Additionally, you can use the included WSGI application to attach to any other server that supports WSGI.\n\nThis package is written in Python 3.\n\n## Installation\n\nThe best option to install is through `pip` by running the command:\n\n```\npip install loopie\n```\nor\n\n```\nsudo pip install loopie\n```\n\n## Example\n\n```python\nimport loopie\n\nclass MyMain(loopie.MainLoop):\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n self.i = 0\n \n def loop_logic(self):\n self.i += 1\n print(self.i)\n \n def importRoutes(self):\n # You can override this method to import the route file or create your on url routes\n super().importRoutes()\n @self.web_app.route('/hello')\n def hello(**kwargs):\n return 'Hello from overridden importRoutes()'\n\nif __name__ == '__main__':\n main = MyMain(name='main', enable_web_browsable_api=True)\n app = loopie.Application(main)\n main.importRoutes()\n \n @main.json_rpc.method('core.MyLoop(uuid=String) -> Object')\n def MyLoop(**kwargs):\n uuid = kwargs.pop('uuid', 'no uuid')\n return dict(app='loopie_test', status='running', i=main.i, uuid=uuid)\n \n app.start()\n print('application ended')\n\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/yaztown/loopie/archive/v0.2.3.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yaztown/loopie", "keywords": "loopie,loop,looping,mainloop,thread,threading,Pi,Raspberry Pi,RPi", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "loopie", "package_url": "https://pypi.org/project/loopie/", "platform": "", "project_url": "https://pypi.org/project/loopie/", "project_urls": { "Download": "https://github.com/yaztown/loopie/archive/v0.2.3.tar.gz", "Homepage": "https://github.com/yaztown/loopie" }, "release_url": "https://pypi.org/project/loopie/0.2.3/", "requires_dist": null, "requires_python": "", "summary": "A simple python framework for creating a looping application (Service).", "version": "0.2.3" }, "last_serial": 5526469, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8db902ceed5013dcc529cd76c39516b8", "sha256": "6770cae82dfbc66075996f6f50962a7a7b41281b5886d4bf8737fdebf1a5910b" }, "downloads": -1, "filename": "loopie-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8db902ceed5013dcc529cd76c39516b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1746, "upload_time": "2019-07-12T09:01:00", "url": "https://files.pythonhosted.org/packages/5e/14/1a9fc0b9ab245c3768a07a22628caaca1022473fc35f26d9bef1e2c87124/loopie-0.1.0.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "1f7437f879b57854cb64505d1184e4ce", "sha256": "8f6a3f96d0ddcf40620e54cfd9e74b9aae2bfee9cac659aad03ad69a4b62179e" }, "downloads": -1, "filename": "loopie-0.2.tar.gz", "has_sig": false, "md5_digest": "1f7437f879b57854cb64505d1184e4ce", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2947, "upload_time": "2019-07-13T05:51:20", "url": "https://files.pythonhosted.org/packages/c7/05/d88f10ffcd360c249122570bceb119c7372369c2506bd7be4709dbbcd69d/loopie-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "cc24bdccee1bae71f80eda3bb2c2f3c5", "sha256": "6aa29885bf9db71ac7d9806c29156acffcc111fd6d095281ee7105d3fdf7a84f" }, "downloads": -1, "filename": "loopie-0.2.1.tar.gz", "has_sig": false, "md5_digest": "cc24bdccee1bae71f80eda3bb2c2f3c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7039, "upload_time": "2019-07-13T06:14:48", "url": "https://files.pythonhosted.org/packages/a1/d1/23e3a61c19b4ceba56df00c189d67c64f4c23258b551406f8c4b1e08aa3f/loopie-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "ce33d8d79ec20d95b6c16817ff6e430c", "sha256": "1507bc75188c51ac39f04e32a238e3c241566a0b4f47c0f7997d265af01c9ca6" }, "downloads": -1, "filename": "loopie-0.2.2.tar.gz", "has_sig": false, "md5_digest": "ce33d8d79ec20d95b6c16817ff6e430c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12252, "upload_time": "2019-07-13T06:22:52", "url": "https://files.pythonhosted.org/packages/a1/31/6bf33cbbf67fe69da25bcf37ff302a509e496a0cb2ece7e52ea778bdf88d/loopie-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "c862a1435f6ce897559ab6849869ceae", "sha256": "6c5f05e68ec0d7699bcbcfd88d4a1c3ad22935bfe9068eedb6e3eb6ccb19fda9" }, "downloads": -1, "filename": "loopie-0.2.3.tar.gz", "has_sig": false, "md5_digest": "c862a1435f6ce897559ab6849869ceae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25991, "upload_time": "2019-07-13T09:07:32", "url": "https://files.pythonhosted.org/packages/f1/3c/1a92e514dd55c537d8b995c0e9c1b63a60c3ae78e8c8c9f1838633b99f35/loopie-0.2.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c862a1435f6ce897559ab6849869ceae", "sha256": "6c5f05e68ec0d7699bcbcfd88d4a1c3ad22935bfe9068eedb6e3eb6ccb19fda9" }, "downloads": -1, "filename": "loopie-0.2.3.tar.gz", "has_sig": false, "md5_digest": "c862a1435f6ce897559ab6849869ceae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25991, "upload_time": "2019-07-13T09:07:32", "url": "https://files.pythonhosted.org/packages/f1/3c/1a92e514dd55c537d8b995c0e9c1b63a60c3ae78e8c8c9f1838633b99f35/loopie-0.2.3.tar.gz" } ] }