The repository pattern is a design pattern that helps you separate business logic from data access code. It does so by providing a unified interface for interacting with different data sources, bringing the following advantages to your system: A practical example Let’s use Python and sqlmodel (PyPI) to demonstrate this pattern (code here): Note: In this implementation,… Continue reading What is the Repository Pattern and How to Use it in Python?
Bob Belderbos
Bob studied business economics, but got fired up about programming early in his career. He taught himself web design / coding and started living his biggest passion: automate the boring stuff, making other people's lives easier. Since then he has coded projects accruing millions in cost savings and built a coding platform that has taught Python to thousands of people worldwide. He deeply cares about helping other people succeed. His biggest win will be your next win!
Deploying a FastAPI App as an Azure Function: A Step-by-Step Guide
By Bob Belderbos on 17 June 2024
In this article I will show you how to deploy a FastAPI app as a function in Azure. Prerequisites are that you have an Azure account and have the Azure CLI installed (see here). Setup Azure First you need to login to your Azure account: It should show your subscriptions and you select the one… Continue reading Deploying a FastAPI App as an Azure Function: A Step-by-Step Guide
Leveraging typing.Protocol: Faster Error Detection And Beyond Inheritance
By Bob Belderbos on 9 February 2024
Introduction Two weeks ago I wrote an article about ABCs and interface enforcement. Shortly after I learned that you can do this as well with protocols. Python 3.8 introduced quite a groundbreaking feature that further advanced the language’s capabilities in type checking: the typing.Protocol which allows Python developers to define and enforce interface contracts in… Continue reading Leveraging typing.Protocol: Faster Error Detection And Beyond Inheritance
How to Send Email Notifications Using Sendgrid and GitHub Actions
By Bob Belderbos on 7 February 2024
Introduction As a Python developer I want to stay up2date with trends and useful tips & tricks. Of course there are great newsletters like Pycoders, but those are already hitting my inbox. Let’s look at Planet Python in this article, an aggregation site/ service that indexes a lot of good Python blog feeds. Keeping an… Continue reading How to Send Email Notifications Using Sendgrid and GitHub Actions
Elevate Your Python: Harnessing the Power of Abstract Base Classes (ABCs)
By Bob Belderbos on 26 January 2024
Introduction One cool object-oriented programming (OOP) technique / pattern is enforcing consistent interfaces. In Python you can use Abstract Base Classes (ABCs) for that. 🐍 Using ABCs ensures that all subclasses implement the required methods. This can make it easier to maintain and extend the existing code base. Update Feb 2024: you can also leverage… Continue reading Elevate Your Python: Harnessing the Power of Abstract Base Classes (ABCs)
Exploring the Role of Static Methods in Python: A Functional Perspective
By Bob Belderbos on 24 January 2024
Introduction Python’s versatility in supporting different programming paradigms, including procedural, object-oriented, and functional programming, opens up a rich landscape for software design and development. Among these paradigms, the use of static methods in Python, particularly in an object-oriented context, has been a topic of debate. This article delves into the role and implications of static… Continue reading Exploring the Role of Static Methods in Python: A Functional Perspective
6 Cool Things You Can Do With The Functools Module
By Bob Belderbos on 21 September 2023
In this article let’s look at the functools Standard Library module and 6 cool things you can do with it (be warned, a lot of decorators are coming your way! 😍) … 1. Cache (“memoize”) things You can use the @cache decorator (formerly called @lru_cache) as a “simple lightweight unbounded function cache”. The classic example is… Continue reading 6 Cool Things You Can Do With The Functools Module
Your First Python Open Source Contribution: A Step-By-Step Guide
By Bob Belderbos on 20 September 2023
Introduction I recently re-engaged with one of my open source projects and it was a rewarding experience. 🎉 It was a Pybites project I had written the core for years ago, but thanks to some amazing Pythonistas in our community it became a way more mature tool so I had to get acquainted again. I… Continue reading Your First Python Open Source Contribution: A Step-By-Step Guide
Debunking 7 Myths About Software Development Coaching
By Bob Belderbos on 12 September 2023
If you give a man a fish, you feed him for a day. If you teach a man to fish, you feed him for a lifetime. Chinese proverb Transformative power of guidance 10 years ago I was overweight, maybe not more than +12 kg, but it definitely had a bearing on the quality of my… Continue reading Debunking 7 Myths About Software Development Coaching
Make Each Line Count, Keeping Things Simple in Python
By Bob Belderbos on 24 August 2023
A challenge in software development is to keep things simple 🤯 For your code to not grow overly complex over time 😱 Simple is better than complex.Complex is better than complicated. Zen of Python 🐍 Simplicity in your code means fewer possibilities for bugs to hide and easier debugging when they do arise 📈 It… Continue reading Make Each Line Count, Keeping Things Simple in Python