Dan Bader

Python Code Review: Unplugged – Episode 3

In this third episode of my video code review series I take a look at a reader’s web scraping project and start adding some unit tests to it.

This is a Python code review I did for Sunny’s web scraping project on GitHub. Sunny reached out to me after watching one of my previous code review videos, asking me if I could give him some feedback on his web scraping pet project.

In this episode you’ll see Flake8 and Python code linting tools make a comeback. Also I’m doing an intro to adding Pytest unit tests to an existing Python code base in the second half of the video.

By the way, I love how eager Sunny was to get feedback on his Python code:

As a pet project I wanted to learn all the best practice as much as I could about python, trying to code as pythonic as I can, checking pep8 and autopep8 (didn’t knew about flake8!!) Eventually I re-factored using classes and methods. If you’ll see that it originally did everything in one monolithic function in the 2.x pull request on github. I still have a few things that I want to implement, so I welcome all kinds of feedback about it!

This is exactly the right mindset that turns people into productive and successful software engineers. Even tiny – but constant – improvements add up and compound over time.

I’ve seen this in friends and colleagues alike. Those developers who seek out constant small improvements eventually go on and do amazing things.

Enjoy the video! And be sure to check out my other Python screencasts if you liked this code review 😊

Links & Resources:

» Click here to watch my other Python Code Review: Unplugged videos

Improve Your Python with a fresh 🐍 Python Trick 💌 every couple of days

🔒 No spam ever. Unsubscribe any time.

This article was filed under: code-review, craftsmanship, programming, python, and video.

Related Articles:
Latest Articles:
  • Context Managers and the “with” Statement in Python – The “with” statement in Python is regarded as an obscure feature by some. But when you peek behind the scenes of the underlying Context Manager protocol you’ll see there’s little “magic” involved.
  • Installing Python and Pip on Windows – In this tutorial you’ll learn how to set up Python and the Pip package manager on Windows 10, completely from scratch.
  • Sublime Text Settings for Writing Clean Python – How to write beautiful and clean Python by tweaking your Sublime Text settings so that they make it easier to adhere to the PEP 8 style guide recommendations.
  • How Sublime Text’s Preferences Work – Sublime Text uses a powerful text-based settings system that can be a little intimidating when you encounter it for the first time. This article gives an overview of the system and points out some common mistakes to avoid.
  • Writing Clean Python With Namedtuples – Python comes with a specialized “namedtuple” container type that doesn’t seem to get the attention it deserves. It’s one of these amazing features in Python that’s hidden in plain sight.
  • Lambda Functions in Python: What Are They Good For? – An introduction to “lambda” expressions in Python: What they’re good for, when you should use them, and when it’s best to avoid them.
← Browse All Articles