Week 15 • Thursday

Block 147: Capstone: API or Interface (Optional)

Expose your project as an API or simple web interface.

Concepts

Code Examples

See exercise below.

Exercise

If ML project: wrap your best model as a FastAPI /predict endpoint with Pydantic validation. If data project: add a Flask /summary route that returns key stats as JSON. Test every endpoint with both valid and invalid inputs.

Homework

What additional features would make your API or interface production-ready? List 5.