🔄 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

  1. A big‑picture recap of core Python skills you now have.

  2. Best practices: structure, naming, type hints, docstrings, error handling.

  3. How to polish and package your mini project (readme, tests, version, distribution).

  4. A 90‑day roadmap to go from beginner → confident practitioner.

  5. 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 of pytest, 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 in tests/.

  • Keep scripts small; put reusable logic in functions/modules.

2) Naming & style

  • Use clear, lowercase_with_underscores for functions/variables, CapWords for 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.txt when you share.

  • Isolate projects with venv so 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:

  1. README.md with: problem statement, features, how to run, examples, and screenshots (optional).

  2. Version your app (e.g., 0.1.0) and print it on startup or in --version.

  3. Basic tests for the main flows.

  4. Packaging (optional): make it installable with a small pyproject.toml and (for CLI) a console_scripts entry point.

  5. 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.

  • --help prints usage; invalid input shows a friendly message.

  • Optional: export to CSV and pretty tables (with rich if 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: /stats endpoint 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.

Keep Reading