A library for interactions.py allowing runtime API structures
Project description
interactions restful
A library for interactions.py allowing runtime API structures
Installation
Using pip:
pip install interactions-restful
Using poetry:
poetry add interactions-restful
Don't forget to specify backend you want to use:
- flask
pip install interactions-restful[flask]
- fastapi
pip install interactions-restful[fastapi]
Simple example
Main file
import interactions
from interactions_restful import setup
from interactions_restful.backends.fast_api import FastAPI
client = interactions.Client()
setup(client, FastAPI, "127.0.0.1", 5000)
client.load_extension("api")
client.start("token")
Extension file
api.py
import interactions
from interactions_restful import route
class MyAPI(interactions.Extension):
@route("GET", "/")
def index(self):
return {"status": "Hello, i.py"}
@interactions.slash_command()
async def test_command(self, ctx):
await ctx.send("Hello, API")
Backends
Currently, library support only flask and fastapi as a backend for building an api, but if you don't want to use them you can create own backend.
Documentation
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
interactions-restful-1.0.0.tar.gz
(15.8 kB
view hashes)
Built Distribution
Close
Hashes for interactions-restful-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb3fe5cc065eb74ee8c01efa38b199f26eab12d7ed6d93db62417325ab6a61a4 |
|
MD5 | e62b6d71e6d957f1de38ad7604f5efcf |
|
BLAKE2b-256 | c33b01b3a10464c5c724049c538e0a2eb4297c37bfc81141479bb5937ebfd900 |
Close
Hashes for interactions_restful-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 376240dd1d012e2178a85b117823a7f92c673a12d31e9a91e072576b00d7edc4 |
|
MD5 | dd12db370f717fe7475b004255614fca |
|
BLAKE2b-256 | 8de56b6424196e2ee50a09b3cceea1b56bf39ba35bc9aa0f9292e5a2388dc310 |