Case Study: Developing and Testing Python Packages with uv

Structuring Python projects properly, especially when developing packages, can often be confusing. Many developers struggle with common questions: To help clarify these common challenges, I’ll show how I typically set up Python projects and organise package structures using the Python package and environment manager, uv. The challenge A typical and recurring problem in Python is… Continue reading Case Study: Developing and Testing Python Packages with uv

Optimizing Python: Understanding Generator Mechanics, Expressions, and Efficiency

Python generators provide an elegant mechanism for handling iteration, particularly for large datasets where traditional approaches may be memory-intensive. Unlike standard functions that compute and return all values at once, generators produce values on demand through the yield statement, enabling efficient memory usage and creating new possibilities for data processing workflows. Generator Function Mechanics At… Continue reading Optimizing Python: Understanding Generator Mechanics, Expressions, and Efficiency

The Mutable Trap: Avoiding Unintended Side Effects in Python

Ever had a Python function behave strangely, remembering values between calls when it shouldn’t? You’re not alone! This is one of Python’s sneakiest pitfalls—mutable default parameters. Recently someone asked for help in our Pybites Circle Community with a Bite exercise that seemed to be behaving unexpectedly. It turned out that this was a result of modifying a mutable parameter… Continue reading The Mutable Trap: Avoiding Unintended Side Effects in Python

Creating a Fitness Tracker App with Python Reflex

In this post, I will build a simple fitness tracker app using Python Reflex. Reflex is a Python library that allows you to create reactive applications using a functional and declarative approach. We will use Reflex to create a simple fitness tracker app that allows you to log the amount of workouts completed per week.… Continue reading Creating a Fitness Tracker App with Python Reflex

A Practical Example of the Pipeline Pattern in Python

What is this pattern about? The Pipeline design pattern (also known as Chain of Command pattern) is a flexible way to handle a sequence of actions, where each handler in the chain processes the input data and passes it to the next handler. This pattern is commonly used in scenarios involving data processing, web scraping,… Continue reading A Practical Example of the Pipeline Pattern in Python

How to convert a Python script into a web app, a product others can use

So, you’re a Python developer or you just use Python to make your life easier by writing utility scripts to automate repetitive tasks and boost your productivity.Such Python scripts are usually local to your machine, run from the command line and require some Python skills to use including for instance setting up a virtual environment… Continue reading How to convert a Python script into a web app, a product others can use