This project is an example of a FastAPI application used to present FastAPI and pydantic for Rocky Python. It is a basic score board application.
The project uses poetry for dependency managment and poethepoet for running tasks.
# with the official installer
curl -sSL https://install.python-poetry.org | python3
#globally with pip
pip install poetry
# or with pipx
pipx install poetry
# systemwide with pip
pip install poethepoet
# or per user with pipx
pipx install poethepoet
poetry install
The project also includes a client implementation using httpx
.
To install client dependencies run
poetry install -E client
This project uses a json file as mock database named fastapi_example.db.json
If this file is missing, it can be generated by running poetry run python scripts/create_data.py
To run the server you can either use the predefined poe task
poe run
Or start it up manually
poetry run uvicorn fastapi_example:app
The demo script scripts/demo.py
shows an example of how to interface with
the API as well as some of its data validation capabilites. The script can be
run with poe via
poe demo