Jonathan Bowman

Tags: tutorial

How to Upgrade to Fedora 37 In Place on Windows Subsystem for Linux (WSL)

The time has once again arrived to upgrade Fedora. As detailed in another article, I installed Fedora on WSL 2. Now I want to upgrade to Fedora version 37. I could do a clean install of course, using the steps detailed in that article, but I want to upgrade in place.

Two Methods for Testing HTTPS API Calls with Python and pytest and Also Communicating with the in-Laws

API endpoints and web URLs are, thankfully, more secure than ever, usually requiring encrypted HTTPS. Python works well as an HTTPS client, and pytest simplifies testing Python-based tools or libraries. Tools like VCR.py or the combination of pytest-httpserver and trustme provide an additional testing layer that is fast and convenient, and well-suited for HTTPS work. This will help with family gatherings. Let me show you.

Hardening and Simplifying Python's urlopen

I recently wrote an article detailing the use of Python’s urlopen() for performing HTTP calls. While researching and writing, I learned of the OpenerDirector class. This class offers the opportunity to streamline urlopen(), make it more secure, and provide custom error handling.

HTTP Calls in Python Without Requests or Other External Dependencies

In addition to great Python HTTP client tools such as Requests and HTTPX, the standard library itself supplies the necessary ingredients to make a working HTTP client for API calls. This tutorial shares how to construct and customize such a tool for your own scripts.

Schedule jobs with systemd timers, a cron alternative

For any sysadmin, devops engineer, or general Linux enthusiast, automating the annoying/boring/difficult stuff is crucial. And task scheduling plays a key role in automation.

Python PDF Generation from HTML with WeasyPrint

While there are numerous ways to handle PDF documents with Python, I find generating or editing HTML far easier and more reliable than trying to figure out the intricacies of the PDF format. Sure, there is the venerable ReportLab, and if HTML is not your cup of tea, I encourage you to look into that option. There is also PyPDF2. Or maybe PyPDF3? No, perhaps PyPDF4! Hmmm… see the problem? My best guess is PyPDF3, for what that is worth.

Flexible CSV Handling in Python with DictReader and DictWriter

The code in this article is also available in a public Github repo here.