💡 Learn how to design great software in 7 steps: https://arjan.codes/designguide.
In this video, I take a deep dive into Python dataclasses in 2025. Are they still useful now that we have Pydantic, FastAPI, SQLAlchemy, and other tools? I walk through real-world examples showing when you should use dataclasses, Pydantic models, and how to design your models cleanly. I’ll also build a small FastAPI app with SQLAlchemy and SQLite to demonstrate proper separation between domain models and API schemas.
🔥 GitHub Repository: https://git.arjan.codes/2025/dataclasses.
🎓 ArjanCodes Courses: https://www.arjancodes.com/courses.
💬 Join my Discord server: https://discord.arjan.codes.
⌨️ Keyboard I’m using: https://amzn.to/49YM97v.
🔖 Chapters:
0:00 Intro
1:11 Quick Refresher – What Are Dataclasses?
4:09 Dataclasses vs Pydantic – And a Real FastAPI Example
6:36 Separate Domain and API Models
8:51 Hybrid Approach in Pydantic
11:53 When Do I Use Dataclasses
14:03 Final Thoughts
#arjancodes #softwaredesign #python