#484 – AUGUST 3, 2021
View in Browser »
In this tutorial, you’ll learn how to use Python to communicate with REST APIs. You’ll learn about REST architecture and how to use the requests library to get data from a REST API. You’ll also explore different Python tools you can use to build REST APIs.
Python 2 was sunsetted over a year ago, but many folks still find themselves maintaining large Python 2 codebases. The Launchpad team recently finished porting their entire codebase to Python 3, and this article reflects on that process, discusses some of the difficulties they encountered, regressions that occurred, and provides a number of lessons they learned throughout the process. If you are in a position of porting a Python 2 codebase to Python 3, definitely check this out.
For software teams, monitoring code health is essential. From Error tracking to Performance monitoring, Sentry helps developers see clearer, solve quicker, and learn continuously about their applications – from frontend to backend. Try Sentry for free → with code: PYCODERS
There’s a new PEP in town, and this one deals with improving how installation requirements are specified in Python projects. The PEP is still in Draft status.
How do you learn a new library? Do you start with the docs? What do you do if the documentation is lacking? Or do you first search for video lessons or written tutorials?
Articles & Tutorials
In this step-by-step tutorial, you’ll learn about Python’s ChainMap and how to use it to group multiple dictionaries together and manage them as a single one. ChainMap is handy when you need to manage multiple scopes and contexts and define access priorities.
The folks over at Ethical Ads recently broke their ads out of the codebase for Read the Docs, where it had been served from a Django app as part of the Read the Docs code line up until 2019. They decided to use Python and Django for their application since the team already knew that stack well. This article compares the performance of hosting services and explains how they stress-tested their application to ensure the best performance at the right cost.
Get hands-on with learning about the new Structural Pattern Matching. PyCharm’s support for Python 3.10 will help you avoid unexpected errors and quickly get to grips with them. If you are as excited about Python 3.10, use the code PYCODERS21 to get 3 free months of PyCharm Professional →
Are you still sprinkling print statements throughout your code while writing it? Print statements are often clunky and offer only a limited view of the state of your code. Have you thought there must be a better way? This week on the Real Python Podcase, Nina Zakharenko discusses her conference talk titled “Goodbye Print, Hello Debugger.”
REAL PYTHON podcast
The folks over at replit have released a new Python web framework with built-in authentication and database support and, more interestingly, hosting. In a few lines of code, you can have a Python web app connected to a database, authenticating users, and hosted on replit. This could be a great tool for quickly building and hosting prototypes or experimental projects.
Do you enjoy collecting and analyzing data, or are you looking for a fun project to improve your data skills? Do you also enjoy tinkering with hardware? Then this project might be a fun one for you to check out! Learn how to set up a RaspberryPi using Prometheus to collect and monitor temperature sensor data.
Tip #1: Avoid PyYAML vulnerabilities by using yaml.SafeLoader() instead of yaml.Loader(). Learn 8 more tips in the Python security cheat sheet.
Learn how to add time delays to your Python programs. You’ll use the built-in time module to add Python sleep() calls to your code. To practice, you’ll use time.sleep() when making an uptime bot that checks whether a website is still live.
REAL PYTHON course
This short yet informative tutorial explains how to Dockerize a Django application. The tutorial clocks in at less than a 10 minute read, but still finds time to explain why you should consider using Docker in your Django projects.
Projects & Code
This was PyCoder’s Weekly Issue #484.
View in Browser »
[ Subscribe to 🐍 PyCoder’s Weekly 💌 – Get the best Python news, articles, and tutorials delivered to your inbox once a week >> Click here to learn more ]