From Backend to Frontend: Connecting FastAPI and Streamlit

In my previous Pybites article, I showed how I built and deployed a book tracking API using FastAPI, Docker, and Fly.io. That project taught me a lot about backend development, containers, and deploying modern APIs. But a backend alone isn’t enough—users need an interface. And FastAPI’s Swagger UI, while useful for testing, just isn’t user-friendly… Continue reading From Backend to Frontend: Connecting FastAPI and Streamlit

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