Skip to main content
r/learnpython icon

r/learnpython

members
online

Things to setup in a python codebase — beginner notes Things to setup in a python codebase — beginner notes

A lot of beginners (including me earlier) can write Python, but get stuck when turning scripts into a real project. Here’s a practical checklist of what “standard” project setup usually includes and what each part is for:

1) Formatting + linting

  • Formatter keeps code style consistent automatically.

  • Linter catches common mistakes (unused imports, bad patterns). Why it matters: easier reviews + fewer silly bugs.

2) Type checking

  • Helps catch mistakes like wrong argument types before runtime. Why it matters: great for refactors and larger codebases.

3) Testing

  • Use pytest to write small tests and run them quickly. Why it matters: confidence when you change code.

4) Pre-commit hooks

  • Automatically runs checks when you commit. Why it matters: prevents “oops I forgot to format” or “tests failing” commits.

5) Docs

  • Even a simple docs site makes projects easier to understand. Why it matters: your future self will thank you.

6) CI (GitHub Actions)

  • Runs the same checks on every PR/push (tests/lint/etc.). Why it matters: ensures code works the same on everyone’s machine.

If anyone wants to see an example of these pieces wired together in a starter project, I put one here:
https://github.com/ritwiktiwari/copier-astral/

Happy to answer questions about any of the pieces above


Your next job could start with Python. Here’s the roadmap Data Scientists follow. Start for free now.
Image Your next job could start with Python. Here’s the roadmap Data Scientists follow. Start for free now.