๐ช Clientele by example
All these examples can be copied and pasted into a file and run in a python application.
Simple GET request
from clientele import api
client = api.APIClient(base_url="https://pokeapi.co/api/v2")
@client.get("/pokemon/{pokemon_name}")
def get_pokemon_info(result: dict, pokemon_name: str) -> dict:
return result
- The simplest logic you can do with Clientele.
- No validation will be ran on the data.
Receive specific data in result
from clientele import api
from pydantic import BaseModel
client = api.APIClient(base_url="https://pokeapi.co/api/v2")
class PokemonInfo(BaseModel):
name: str
id: int
@client.get("/pokemon/{pokemon_name}")
def get_pokemon_info(result: PokemonInfo, pokemon_name: