Hands-on practice repo for learning Python as applied to DevOps and cloud (AWS) automation — scripting fundamentals, subprocess handling, filesystem operations, boto3/AWS automation, and testing with pytest.
This is built for educational purposes, not a polished tool library: each dayN_topic folder is a self-contained set of small scripts written to practice one concept, along with tests for each. Code quality and scope grow as the days progress.
.
├── day1_scripting_basics/
│ ├── check_env.py
│ ├── test_check_env.py
│ └── ...
├── day2_subprocess/
│ └── ...
Each script is runnable standalone and follows a consistent pattern: CLI args via argparse, explicit exit codes, and a main() function structured for testability (no logic executed at import time).
Requires Python 3.10+ and pytest.
pip install -r requirements.txtRun all tests from the repo root:
pytest -vRun a single day's tests:
pytest day1_scripting_basics/ -vRun tests matching a keyword:
pytest -k "config" -vRun an individual script directly, e.g.:
python day1_scripting_basics/check_env.py --env staging --verbose| Day | Topic | Notes |
|---|---|---|
| 1 | Scripting fundamentals — argparse, env vars, exit codes, precedence logic, pytest basics (monkeypatch, capsys) |
parse_args |
| 2 | Subprocess — shelling out to CLI tools, capturing output/exit codes | subprocess, try/except |
| 3 | Filesystem operations — directories, metadata, and cleanup patterns | pathlib, tmp_path |
(updated as new days are added)