Further Reading — Chapter 39: Python Best Practices and Collaborative Development
Version Control and Git
Pro Git — Scott Chacon and Ben Straub The definitive Git reference, available free at https://git-scm.com/book/en/v2. Chapters 1–3 cover everything a business Python developer needs. Chapter 6 covers the GitHub-specific workflow.
Oh Shit, Git!?! — Katie Sylor-Miller (https://ohshitgit.com) A profanity-laden, genuinely useful reference for the moments when Git does something unexpected and you need to know how to undo it. Every developer has this page bookmarked.
Atlassian Git Tutorials (https://www.atlassian.com/git/tutorials) Visual explanations of branching, merging, rebasing, and the pull request workflow. The "Getting Started" and "Collaborating" sections are particularly clear.
Testing
Testing Python Applications with pytest — Brian Okken (Pragmatic Bookshelf) The most comprehensive pytest reference available. Covers fixtures, parametrize, plugins, and CI integration. The "pytest for the working developer" perspective aligns well with this book's audience.
The Art of Unit Testing — Roy Osherove (Manning) Language-agnostic but the principles translate directly to Python. Chapters 1–4 are required reading for anyone who wants to understand why tests are structured the way they are.
pytest Documentation (https://docs.pytest.org) The official docs are unusually good. The "Getting Started" guide and the "How-to guides" section cover everything in this chapter and considerably more.
Effective Python Testing with pytest — Real Python (https://realpython.com/pytest-python-testing/) A comprehensive tutorial that covers fixtures, parametrize, and test organization in the context of realistic Python projects.
Type Hints and mypy
mypy Documentation (https://mypy.readthedocs.io) The official mypy docs. The "Getting started" and "Type system reference" sections are the most useful for business Python developers.
PEP 484 — Type Hints (https://peps.python.org/pep-0484/) The original specification for type hints in Python. Dense but authoritative.
Python Type Checking (Guide) — Real Python (https://realpython.com/python-type-checking/)
A practical tutorial on type hints, Optional, Union, TypedDict, Protocol, and mypy. The best single resource for getting up to speed quickly.
Hypermodern Python — Claudio Jolowicz (https://cjolowicz.github.io/posts/hypermodern-python-01-setup/) A series of articles covering the modern Python toolchain including mypy, type hints, and static analysis in a production context.
Code Style and Linting
PEP 8 — Style Guide for Python Code (https://peps.python.org/pep-0008/)
The official style guide. Read it once, then let black enforce it for you.
black Documentation (https://black.readthedocs.io) Covers configuration, editor integration, pre-commit setup, and the philosophy behind black's opinionated choices.
flake8 Documentation (https://flake8.pycqa.org) Complete reference for all flake8 error codes and how to configure the tool for your project.
pre-commit Documentation (https://pre-commit.com) Everything you need to set up automated hooks for black, flake8, mypy, and dozens of other tools.
Code Review
Code Review Best Practices — Palantir Engineering (https://github.com/palantir/gradle-baseline/blob/develop/docs/best-practices/code-reviews/README.md) Detailed guidance on giving and receiving code review feedback in a professional context. The distinction between "nit" (style preference), "suggestion" (non-blocking), and "blocker" is well explained.
Google Engineering Practices — Code Review (https://google.github.io/eng-practices/review/) Google's internal code review guidelines, made public. The "The Standard of Code Review" and "Speed of Code Reviews" sections are particularly relevant.
Project Structure and Professional Practice
Cookiecutter Data Science (https://drivendata.github.io/cookiecutter-data-science/) A standardized project structure for data science projects, with clear reasoning for each directory. More complex than what most business analysts need, but a useful reference for larger projects.
The Pragmatic Programmer — Andrew Hunt and David Thomas (Addison-Wesley) The book that coined "DRY" (Don't Repeat Yourself) and many other principles that underpin good software practice. Not Python-specific, but every principle applies directly. Chapter 7 on "Coding" and Chapter 8 on "Before the Project" are particularly relevant.
Clean Code — Robert C. Martin (Prentice Hall) A widely read reference on writing code that humans can understand. The chapter on meaningful names and the chapter on functions translate well to Python. Read critically — some advice is dated or overly prescriptive for a non-professional-developer audience.
Tools to Install Now
All of the following integrate with VS Code, PyCharm, and most other Python editors:
# Testing
pip install pytest pytest-cov
# Type checking
pip install mypy
# Formatting
pip install black
# Linting
pip install flake8
# Pre-commit hooks
pip install pre-commit
# Optional: isort (sorts your imports automatically)
pip install isort
VS Code extensions to install: - Python (Microsoft) — the base extension - Pylance — type checking integrated into the editor - Black Formatter — runs black on save - GitLens — enhanced Git history visualization in the editor