Development Workflow¶
Learn how code moves from idea to repeatable, documented, versioned work instead of living as one-off experiments.
After choosing tools in the previous notebook, the next question is workflow: how do you organize files, use the terminal, manage environments, track changes, document decisions, and automate repeated tasks without chaos?

A workflow is how professionals reduce avoidable mistakes¶
Beginners often focus only on writing code. Professionals also think about where code lives, how it is run, how it is shared, and how it is recovered when something breaks.
That matters in business and ML because analysis, models, reports, and deployment steps usually happen more than once.
Workflow Roadmap¶
Core Ideas¶
The command line is useful for running scripts, moving files, installing packages, and chaining tasks. You do not need to memorize everything at once, but you do need to become comfortable reading commands carefully.
A virtual environment keeps project dependencies isolated so one project does not silently break another. That becomes especially important in machine learning work where package versions can matter a lot.
Git records meaningful snapshots of work. It helps you recover from mistakes, collaborate safely, and explain what changed over time.
A good workflow records setup steps and turns repeated tasks into scripts. That makes work more reproducible for future you and for teammates.
A simple command-line workflow example
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python train_model.py
git add .
git commit -m "Add first training workflow"Each line supports a different workflow concern: environment setup, dependency installation, execution, and version tracking.
project_files = ["README.md", "requirements.txt", "train.py", "data/", "notebooks/"]
required = ["README.md", "requirements.txt", "train.py"]
missing = [name for name in required if name not in project_files]
print("Missing critical files:", missing if missing else "None")Missing critical files: None
Worked Example: A Small Repeatable Project Loop¶
Imagine a business analyst updating a weekly sales model. A reasonable workflow might look like this:
activate the correct environment
pull in the latest data
run the training or reporting script
inspect the results
commit the meaningful change with a clear message
source .venv/bin/activate
python fetch_sales_data.py
python weekly_report.py
git add reports/ weekly_report.py
git commit -m "Update weekly sales report workflow"Why this is better than ad hoc work
the environment is explicit
the execution steps are repeatable
the change history is recorded
another person can follow the same sequence later
Documentation as Part of Workflow¶
A development workflow is incomplete if someone else cannot understand how to run the project. Even a short README that explains setup, dependencies, and main commands can save hours later.
workflow_steps = [
("activate environment", True),
("run data update", True),
("generate report", True),
("commit changes", False),
]
completed = [step for step, done in workflow_steps if done]
remaining = [step for step, done in workflow_steps if not done]
print("Completed steps:", completed)
print("Remaining steps:", remaining)Completed steps: ['activate environment', 'run data update', 'generate report']
Remaining steps: ['commit changes']
Exercises¶
Write a short workflow for a notebook-based analysis that you might repeat every week.
Explain why a virtual environment helps when two projects need different package versions.
Give one example of a good Git commit message and one example of a weak one.
Name one task you would automate with a script instead of doing manually every time.
Practice prompt
Suppose your team runs the same data-cleaning script every morning and then emails a report. Which parts of that process could be turned into a small shell script or scheduled task?
Quick Summary
a development workflow connects coding, execution, versioning, documentation, and automation
shell tools and virtual environments help keep work reproducible
Git records changes so experiments and fixes are traceable
automation matters because real projects repeat tasks constantly
The next notebook, Writing Your First Python Program, narrows from workflow habits to the smallest concrete unit of programming: writing and running a simple Python script correctly.