Reading Python Code

Some of the code libraries I plan on reading to improve my Pythonic style

Alex Strick van Linschoten


September 18, 2021

It’s a truism of sorts that in order to improve your skills, you have to practice them. For coding, the stereotypical image is of someone typing, actually creating new things. But as often as not, you’re going to be reading code instead. This code might be something you write yesterday or last year, or it might be something that someone else wrote.

One way or another, reading code is a great way to get increasing familiarity with stylistic, syntactic patterns and to get exposed to some best practices, especially if you get to pick the code you’re reading.

I’ll be doing the same as I ramp up my Python proficiency. I wanted to gather some lists of codebases and assorted resources in one place for myself, and I hope maybe it’ll be useful for someone else as well.

Good Quality Python Code

  • jinja — a templating engine written in Python (and see the recommendations for supplemental reading and watching for jinja here)
  • howdoi — a search tool for coding answers via the command line
  • flask — a micro-web framework for Python
  • FastAPI — another web framework that’s a bit larger than flask
  • diamond — a Python daemon that collects and publishes system metrics
  • werkzeug — a web server gateway library
  • requests — an HTTP library, now part of the Python standard library
  • tablib — library for Pythonic way to work with tabular datasets
  • click — a Python package for creating command line interfaces
  • pathlib — part of the Python standard library; a module to handle filesystem paths (also the corresponding PEP proposal #428)
  • dataclasses — a module in the Python standard library; reduces boilerplate of writing classes (also the corresponding PEP proposal #557)
  • joblib — a library to support lightweight pipelining in Python

Other Resources