A Git repository holding a tested Python package, a SQLite database built by a script, and a FastAPI service that starts in a container with one command.
Start a Git repository with a .gitignore, and make one small commit for each step that follows.
Download a public CSV, check it with head, wc and a cut | sort | uniq -c pipeline, and save those checks as a script with set -euo pipefail.
Load it into SQLite from a package laid out with pyproject.toml, and write three pytest tests for the loader, one with an awkward row.
Add a FastAPI endpoint that answers one question with a parameterised SQL query and checks its input with Pydantic.
Write a Dockerfile that builds the database and starts the service.
Do the work on a branch and merge it back once the tests pass.
How you'll know it worksFrom a fresh clone, one command builds and starts the container, curl returns the answers you checked by hand for three queries, and pytest passes.
Git, a terminal, Python with FastAPI and pytest, SQLite and Docker, all free and local. Uses lessons 01 to 12.
Project: A small data API, from repo to container
From insideout, Engineering Toolkit: A Git repository holding a tested Python package, a SQLite database built by a script, and a FastAPI service that starts in a container with one command.
Steps:
1. Start a Git repository with a .gitignore, and make one small commit for each step that follows.
2. Download a public CSV, check it with head, wc and a cut | sort | uniq -c pipeline, and save those checks as a script with set -euo pipefail.
3. Load it into SQLite from a package laid out with pyproject.toml, and write three pytest tests for the loader, one with an awkward row.
4. Add a FastAPI endpoint that answers one question with a parameterised SQL query and checks its input with Pydantic.
5. Write a Dockerfile that builds the database and starts the service.
6. Do the work on a branch and merge it back once the tests pass.
How you'll know it works: From a fresh clone, one command builds and starts the container, curl returns the answers you checked by hand for three queries, and pytest passes.
Runs on: Git, a terminal, Python with FastAPI and pytest, SQLite and Docker, all free and local.
Help me build this on my machine, one step at a time. Ask what I've tried first, give hints before full answers, and check my work against "How you'll know it works".