{"id":15009528,"url":"https://github.com/alecyrus/allegro","last_synced_at":"2025-04-09T17:24:42.808Z","repository":{"id":57409805,"uuid":"88318524","full_name":"Alecyrus/Allegro","owner":"Alecyrus","description":"A python backend integration framework","archived":false,"fork":false,"pushed_at":"2018-10-29T12:06:52.000Z","size":135,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T15:56:41.659Z","etag":null,"topics":["python-3-5","rabbitmq","restful-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alecyrus.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-04-15T02:38:37.000Z","updated_at":"2018-04-21T22:57:52.000Z","dependencies_parsed_at":"2022-08-24T20:00:10.029Z","dependency_job_id":null,"html_url":"https://github.com/Alecyrus/Allegro","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alecyrus%2FAllegro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alecyrus%2FAllegro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alecyrus%2FAllegro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alecyrus%2FAllegro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alecyrus","download_url":"https://codeload.github.com/Alecyrus/Allegro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248075659,"owners_count":21043630,"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":["python-3-5","rabbitmq","restful-api"],"created_at":"2024-09-24T19:26:09.671Z","updated_at":"2025-04-09T17:24:42.774Z","avatar_url":"https://github.com/Alecyrus.png","language":"Python","readme":"# Allegro\n\n[![Join the chat at https://gitter.im/Alecyrus/Lobby](https://badges.gitter.im/Alecyrus/Lobby.svg)](https://gitter.im/Alecyrus/Lobby?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Build Status](https://travis-ci.org/Alecyrus/Allegro.svg?branch=master)](https://travis-ci.org/Alecyrus/Allegro)\n[![PyPI version](https://img.shields.io/pypi/pyversions/allegro.svg)](https://pypi.python.org/pypi/Allegro)\n[![PyPI](https://img.shields.io/pypi/v/allegro.svg)](https://pypi.python.org/pypi/Allegro)\n\nAllegro is a python backend integration framework, which provides a simple way to make the task of building any kind of RESTFul system easy and efficient. The RESTFul service is based on [sanic](https://github.com/channelcat/sanic), and [Celery](http://www.celeryproject.org/) provides tasks scheduler service. \n\nWith the framework, the API can be defined through a config file, and we just focus on the processing logic. What's more, it' very efficient and easy for frond-end to build a mock server.\n\n## Installation\n\u003e `pip3 install allegro`\n\nIt only supports Python3.5 or higher.\n\n## Get Started\n### start.py\n```python\nfrom allegro import Allegro\n\napp = Allegro(\"test_project\")\napp.initialize(\"test.ini\")\napp.start()\n```\n\n### stop.py\n```python\nfrom allegro import Allegro\n\napp = Allegro(\"test_project\")\napp.initialize(\"test.ini\")\napp.stop()\n```\n\n### task1.py\n```python\nfrom celery import Celery\n\napp = Celery('tasks', backend='redis://localhost:6379/0', broker = 'redis://localhost:6379/0')\n\n\n@app.task\ndef get(message):\n    print(message)\n    return {\"app\":\"Get Got\"}\n\n@app.task\ndef post(message):\n    print(message)\n    return {\"app\":\"Post Got\"}\n\n```\n### settings.ini\n```ini\n[basic]\n;The ip address of the host you runs the RESTFul API service\nbind_host = 0.0.0.0\n;The port\nbind_port = 8000\n;The number of the RESTFul API service process\napi_worker = 3\n;The directory where the consumer modules you defined can be found \nroot_path = /home/luze/Code/Allegro/examples\n;The file that contains the pids of all the process\npid_path = /tmp/my_project_pid_file\n;Timeout\ntimeout = 60\n\n[service]\n;The services your projects provided. If you want to define more than\n;one service, separate each service's name by a comma. And then you must \n;define every service's specific information with a section named after\n;the service'name.\nkeys = Test1Service\n\n\n[Test1Service]\n;The uri of the service. And the api can be accessed by the url;\n;(http://bind_host:bind_port/uri)\nuri = /test1\n;The HTTP method the service's API provided.\nmethod = get,post\n;The module where the handler class is located\nmodule = task1\n;The number of the service workers. If the value of eventlet_enabled is True, the item will be of no effect\nworkers = 3\nprocesses_pool = 10\n;use eventlet  \neventlet_enabled = True\neventlet_pool = 1000\n\nfile_upload_enabled = False\n```\n\n\n#### Run the command:\n\u003e `# python3 start.py`\n\n#### Call the API(example: http://localhost:8000/test1 (POST))\n\n#### Respose:\n\u003e`{\"app\":\"Get Got\"}`\n\n#### Run `python3 stop.py` to terminate the program.\n\n## License\nAllegro is open source and released under the MIT Licence.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecyrus%2Fallegro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falecyrus%2Fallegro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecyrus%2Fallegro/lists"}