Compare commits

..

3 commits

Author SHA1 Message Date
Yarne Coppens
30ea0d8fec Accidentally used non-neutral pronoun in README 2024-08-01 10:15:17 +02:00
Yarne Coppens
7279d9f93c Grammatical fix on README 2024-07-27 10:33:50 +02:00
Yarne Coppens
7d1b3458e7 Updated README 2024-07-26 10:50:46 +02:00
3 changed files with 2 additions and 39 deletions

View file

@ -1,2 +1,4 @@
# bgg_api
An API implementation that will be used by my own board game website.
The plan is for this API to be used by a single person who wants their board game collection to be cached so that retrieval is much faster.

View file

@ -1,19 +0,0 @@
from pydantic import BaseModel, HttpUrl
class BoardGame(BaseModel):
id: int
name: str
description: str
image_url = HttpUrl
thumbnail_url = HttpUrl
year_published: int
min_players: int
max_players: int
min_playing_time: int
max_playing_time: int
min_age: int
all_expansion_ids: list[int]
class BoardGameExpansion(BoardGame):
pass

20
main.py
View file

@ -1,20 +0,0 @@
from typing import Union
from fastapi import FastAPI
from classes.boardgame import BoardGame, BoardGameExpansion
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
@app.get("/boardgame/{boardgame_id}", response_model=BoardGame)
def get_boardgame_by_id(boardgame_id: int):
pass