🔄 Quick Recap (Day 29)
You expanded your mini project: added features, validation, and persistence for either the CLI Habit Tracker or the Pocket Tasks API.
🎯 What You’ll Learn Today
A big‑picture recap of core Python skills you now have.
Best practices: structure, naming, type hints, docstrings, error handling.
How to polish and package your mini project (readme, tests, version, distribution).
A 90‑day roadmap to go from beginner → confident practitioner.
Where to keep learning (articles, docs, and an advanced course link you’ll find in the blog’s CTA block).
🧭 Your 30‑Day Knowledge Map
You’ve touched every essential layer:
Python Basics: variables, data types, control flow, functions.
Collections & Patterns: lists/tuples/dicts/sets, comprehensions, generators.
Files & Errors: file I/O, context managers, exceptions.
Environments & Packages:
venv,pip, requirements,pyproject.toml.Standard Library:
os,sys,datetime,json,collections.Data Skills: NumPy arrays, Pandas DataFrames, data cleaning, joins.
Visualization: Matplotlib basics.
Web Basics: requests + BeautifulSoup scraping.
Testing & Debugging:
unittest, a taste ofpytest, breakpoints.Frameworks: Flask/Django/FastAPI quick starts.
Automation:
subprocess, cron/Task Scheduler.Project Work: feature design, persistence, and a working app.
Keep this map as a checklist when you describe your skills to others.
✅ Best Practices You Can Start Using Today
1) Project structure
Group code by purpose:
app/for logic,data/for storage, tests intests/.Keep scripts small; put reusable logic in functions/modules.
2) Naming & style
Use clear, lowercase_with_underscores for functions/variables,
CapWordsfor classes.Prefer short, readable functions. One job per function.
3) Type hints & docstrings
Add hints for parameters and return types.
Top of each function, include a short docstring: what it does, inputs, output, and any exceptions.
4) Errors & validations
Validate input early; raise helpful errors with context.
Catch only the exceptions you expect; let the rest surface during development.
5) Dependencies
Pin versions in
requirements.txtwhen you share.Isolate projects with
venvso nothing conflicts.
6) Tests
Write at least one test for each feature (happy path + one edge case).
Re‑run tests after every change to prevent regressions.
🧩 Polish Your Mini Project (Both Tracks)
Add these finishing touches:
README.md with: problem statement, features, how to run, examples, and screenshots (optional).
Version your app (e.g.,
0.1.0) and print it on startup or in--version.Basic tests for the main flows.
Packaging (optional): make it installable with a small
pyproject.tomland (for CLI) aconsole_scriptsentry point.Data safety: handle missing/corrupt JSON gracefully and create the data folder at runtime.
CLI checklist
Commands: add/list/edit/done/del/stats all work.
--helpprints usage; invalid input shows a friendly message.Optional:
exportto CSV and pretty tables (withrichif installed).
API checklist
Endpoints: POST/GET/PATCH/DELETE all return expected JSON/status codes.
Query params for filters/pagination validated; bad inputs return clear errors.
Optional:
/statsendpoint and OpenAPI docs reviewed at/docs.
🛠️ Example: Add a --version Flag (CLI)
# snippet you can add to app/main.py
from importlib.metadata import version, PackageNotFoundError
# after ArgumentParser creation
p.add_argument("--version", action="store_true", help="Show version and exit")
# after parsing args
if getattr(args, "version", False):
try:
print("habits", version("habits"))
except PackageNotFoundError:
print("habits 0.1.0") # fallback if not installed as a package
raise SystemExit(0)Expected output:
habits 0.1.0🚀 Your 90‑Day Growth Roadmap
Weeks 1–2: Foundations, again (faster)
Re‑read your favorite lessons and rebuild 3–4 exercises from memory.
Add type hints and docstrings where missing.
Weeks 3–4: Testing & Style
Expand tests; aim for coverage on core logic.
Learn a formatter/linter (e.g.,
black,ruff) and apply them.
Weeks 5–6: Data or Web specialization
Data path: Pandas joins, datetime wrangling, groupby, plotting; small analysis project.
Web/API path: FastAPI deeper dive—request models, auth basics, error handlers.
Weeks 7–8: Databases & Auth
SQLite or PostgreSQL; practice migrations and CRUD.
For APIs, add auth (tokens or sessions) and document your endpoints well.
Weeks 9–12: Portfolio Project
Pick a realistic idea; draft features, design data, build iteratively.
Add tests, logs, and a short demo video.
Write a one‑page README with a quick start command.
📚 Keep Learning
Official Docs: Python, NumPy, Pandas, Matplotlib, FastAPI/Django/Flask.
Problem‑solving: small daily coding challenges (focus on clarity, not tricks).
Deep Dives: when a topic confuses you, skim documentation, then rebuild a tiny example.
Thanks for learning with Digital Mago.
You’ve put in real work—now keep the momentum going. The next step is simple: pick one path (Data or Web), open today’s “Continue learning” card, and take the next challenge. Your future self will thank you.