{"id":15792835,"url":"https://github.com/interactions-py/restful","last_synced_at":"2025-04-01T16:30:35.121Z","repository":{"id":50508197,"uuid":"519271536","full_name":"interactions-py/restful","owner":"interactions-py","description":"An extension library for interactions.py allowing runtime API structures.","archived":false,"fork":false,"pushed_at":"2023-08-11T05:52:11.000Z","size":102,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-13T21:56:40.273Z","etag":null,"topics":["api","api-rest","discord","fastapi","interactions","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interactions-py.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,"governance":null}},"created_at":"2022-07-29T15:56:44.000Z","updated_at":"2023-11-17T16:43:30.000Z","dependencies_parsed_at":"2023-07-13T04:30:38.796Z","dependency_job_id":null,"html_url":"https://github.com/interactions-py/restful","commit_stats":{"total_commits":44,"total_committers":3,"mean_commits":"14.666666666666666","dds":"0.20454545454545459","last_synced_commit":"30003b4c54421686208a5affcd123626a35f2747"},"previous_names":["damego/interactions-fastapi"],"tags_count":4,"template":false,"template_full_name":"Damego/python-pypi-project-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactions-py%2Frestful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactions-py%2Frestful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactions-py%2Frestful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactions-py%2Frestful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interactions-py","download_url":"https://codeload.github.com/interactions-py/restful/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246620224,"owners_count":20806722,"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":["api","api-rest","discord","fastapi","interactions","python"],"created_at":"2024-10-04T23:05:09.510Z","updated_at":"2025-04-01T16:30:35.100Z","avatar_url":"https://github.com/interactions-py.png","language":"Python","readme":"# interactions restful\n\nA library for interactions.py allowing runtime API structures\n\n## Installation\n\nUsing pip:\n`pip install interactions-restful`\n\nUsing poetry:\n`poetry add interactions-restful`\n\nDon't forget to specify backend you want to use:\n- [FastAPI](https://fastapi.tiangolo.com/): `pip install interactions-restful[fastapi]`\n- [Quart](https://pgjones.gitlab.io/quart/index.html): `pip install interactions-restful[quart]`\n\nAlso make sure to install an ASGI server:\n- [Uvicorn](https://www.uvicorn.org/): `pip install interactions-restful[uvicorn]`\n- [Hypercorn](https://pgjones.gitlab.io/hypercorn/): `pip install interactions-restful[hypercorn]`\n- [Daphne](https://github.com/django/daphne): `pip install interactions-restful[daphne]`\n\nYou can also install both your backend and ASGI server at once, for example\n`pip install interactions-restful[fastapi,uvicorn]`\n\n## Simple (FastAPI) example\n\n### Main file\n- `main.py`\n\n```python\nimport interactions\nfrom fastapi import FastAPI\nfrom interactions_restful.backends.fastapi import FastAPIHandler\n\napp = FastAPI()\n\nclient = interactions.Client(token=\"token\")\nFastAPIHandler(client, app)\n\nclient.load_extension(\"api\")\n```\n\n### Extension file\n- `api.py`\n\n```python\nimport interactions\nfrom interactions_restful import route\n\n\nclass MyAPI(interactions.Extension):\n    @route(\"GET\", \"/\")\n    def index(self):\n        return {\"status\": \"Hello, i.py\"}\n\n    @interactions.slash_command()\n    async def test_command(self, ctx):\n        await ctx.send(\"Hello, API\")\n```\n\n### Run\n\n```bash\nuvicorn main:app --reload\n```\n\n## Backends\n\nCurrently, the library support only Quart and FastAPI as a backend for building an API, but if you don't want to use them you can create own backend.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteractions-py%2Frestful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finteractions-py%2Frestful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteractions-py%2Frestful/lists"}