Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

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

Terminal and shell habits
Environment management
Version control
Documentation and automation

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 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:

  1. activate the correct environment

  2. pull in the latest data

  3. run the training or reporting script

  4. inspect the results

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

  1. Write a short workflow for a notebook-based analysis that you might repeat every week.

  2. Explain why a virtual environment helps when two projects need different package versions.

  3. Give one example of a good Git commit message and one example of a weak one.

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