Project-based resources for learning best practices?

I’m writing a blog post on building a portfolio of Python projects, and I’d love to hear more perspectives on how to progress from courses to proper projects that follow Python best practices. I see lots of books/videos that have projects, but almost none of them model practices like:

  • Modularity
  • Version & dependency management
  • Documentation
  • Logging
  • Testing

How do newbies make this leap? I’m sure there many ways, but there isn’t an obvious one that I know of. I asked this question on Mastodon as well and got recommendations for Steven Lott’s Python Real-World Projects and UMassCDS’ Python Project Template, but I thought I’d ask here as well. :blush:

NB: I’m looking specifically for recommendations for resources that provide direct instruction on implementing these practices. I know lots of folks learn them by contributing to OSS projects, but for this purpose I’m optimizing for scaffolding.

2 Likes

The cookiecutter project has been popular for many years. There are a number of templates that help users bootstrap projects with best practices. https://www.cookiecutter.io/

2 Likes

pyOpenSci’s community resources and peer review guide also scaffold best practices for Python development: Python Tutorials & Learning Resources for Scientists - pyOpenSci

1 Like

Scientific Python also has a nice guide to best practices and I believe a cookie-cutter: Home - Scientific Python Development Guide

1 Like

I’m unsure if this is what you’re looking for, but I’ve found some project docs have useful explanations, directory layouts, and reasons why to choose (or not choose) particular approaches.

For example:

2 Likes

Thank you! I think one of the projects I linked built upon the cookiecutter project, and I’ve heard great things about both! :blush:

1 Like

Thanks, I’ll check it out! :blush: