Python offers lot of built-in functions out of the box. However, their official documentation is more focused on their technical details rather than introducing them to more novice people. This great article from Matt Layman list, document and provide examples for all those functions in a more friendly manner.
read moreOther articles
Asyncio Event loop in separate thread
If you ever wanted to use synchronous and asynchronous code in the same program you should definitively have a look at this article. It will also gives you a better understand of the magic behind
read moreasyncio
and the famous Event Loop.Python's many command-line utilities
Python has many modules in its standard library that you can use directly from the command line. If you already used one day python -m
read morehttp.server
to quickly run a web server locally, you'll discover lot of other useful commands in this article. Pin this on your browser favorites!Resource management and generators in python
If, like me, you were not aware that python generators (async and normal) has a
read moreclose
function with a cleanup mechanism, I strongly suggest you to read this article. You'll never forget to close your generators properly anymore.You don't have to guess to estimate
If you are a software engineer, there is one hundred percent chances that at least one time in your career someone asked you to estimate some tasks. If you feel like, most of the time, estimating is just like guessing you should know that there is actually more concrete way of estimating.
read moreModule itertools overview
There is lot of things you can do, out of the box, using Python standard library. Here is a great article from Rodrigo detailing the Python
read moreitertools
module. I've personally discovered tons of ways to iterate over collections I could not have even imagined. Rule of thumb: before developing something, double check it does not already exist on the standard library.Simple CSS
Sometimes you want to build a web application but you're quickly discouraged because you know you'll have to write CSS so it does not look like crap. If you're not CSS proficient you know it can be challenging (even using some existing frameworks). I present you Simple CSS, a very simple css framework (mostly classless) to use on your website to make it just looks good.
read moreToasts are bad UX
Toasts are a very popular mechanism for UX design in order to give feedback to an user for actions/interactions. However, it might not always be the best mechanism to use in all cases, here is why.
read moreProcessing large JSON files in Python without running out of memory
If you ever struggled reading large JSON files using Python this article highlight several strategies to overcome memory issues. If personally think that JSON Lines is a very underestimated solution for streaming (read/write) JSON.
read more6 cool things you can do with the functools module
The Python
read morefunctools
module from the standard library has many gems that I'm using quite regularly. Discover 6 of them with examples and use cases.Renaming files using Python script
Lately, I wanted to rename lot of files and directories on my personal server, in particular media like TV Shows episodes. As there was lot of files I decided to look for an UNIX command to ease my burden. Unfortunately, I could not find such command on my server (a Synology NAS) and was unable to figure out how to install additional packages on it so I decided to build my own
read morerename
command using a Python script.On the importance of naming in programming
I heard about the importance of naming in programming a couple years ago while reading Uncle Bob's Clean Code book. But I found this article to provide interesting examples as well as some nice tips on how to help you actually naming things. It also emphasis on the fact that names heavily depends on context and can actually highlight "bad code" in some ways.
read moreExecute a function until a specific value is returned
I had barely no idea that the
read moreiter
function could do that in Python. You can call it with two arguments, a function and a stop value, and have your function being executed until the stop value is returned. It can have some interesting usages, as shown in the article. I would not use it all over the place because it looks like a bit dark magic but still a nice tool to keep in mind.8 versions of UUID and when to use them
I'm used to UUID v4 to generates random globally unique IDs whenever I need it in places where I can not benefit from a database with an auto numbering column. Actually, this is just the tree hiding the forest of UUIDs. This great article list the 8 versions of UUID and explain what they are about and when to use them.
read moreModern good practices for Python development
I should definitively write my own set of guidelines and practices for Python development. For the moment you can already find some in this article. I agree with most of the practices outlined expect maybe using TOML for configuration files (I prefer relying on environment variables and
read more.env
files). I would also recommend to opt for typer instead ofargparse
for more complex CLIs. Finally I would suggest using tools like uv or pdm to manage your project (packaging, dependencies, virtual environment).Practices of reliable software design
In the following article, the author discuss some interesting practices, not only tied to coding, for building and designing reliable softwares. There is one I particularly emphasis with is the Make testing easy which, in my opinion, is the cornerstone of good software design which is way too much overlooked in a lot of projects and companies.
read more10 Python programming optimisation techniques.
In this article, the author provide some interesting techniques for optimising Python code, in particular, memory consumption for cases where memory is critical or resources are limited. I would personally not apply all those techniques by default and reserve them for specific use cases, preferring readability in a first place. Still, those techniques are interesting to have in mind.
read morePython packaging is great now, uv is all you need
To facilitate managing my Python projects managing and packaging I'm using PDM. This tool is really great and has lot of very nice features that will really simplify your life for building either applications or libraries. Lastly the guys from Astral (creators of ruff) made lot of improvement to their own similar tool,
read moreuv
. In this article, Juan Luis Cano Rodríguez quickly explain whyuv
is a serious contender in the Python project managing/packaging game.Integrating Problem Details RFC with FastAPI
During my past development projects, I built a lot of HTTP APIs using various langages (TypeScript, JavaScript, Python) and frameworks (fastify, FastAPI, flask, express). One thing I've noticed is that each of those frameworks have their own way of shaping HTTP error responses. This is actually not a big deal considering that most clients (i.e: HTTP clients) do not really rely on strict structure for such errors.
read moreTesting Python code integration with an Azure Eventhub
On one of my project I needed to create a simple API allowing clients to publish some messages into an Azure EventHub. Because authentication is ensured by a JWT we could not rely on our clients to directly publish messages to the Eventhub (and by the way I prefer abstracting this away through a HTTP API).
read moreDebugger doesn't stop at breakpoints with pytest if pytest-cov is used
Recently, while trying to debug some of my
read morepytest
tests using VSCode, I discovered that my breakpoints were completely ignored and the tests never stopped. After nearly breaking my keyboard in frustration, I stumbled upon this GitHub issue.One way to fix Python circular imports
I've already encountered issues regarding circular imports, most of the time it was related to typings only (two modules referencing types from each others) and is easily resolved using a
read moreif TYPE_CHECKING:
block. For other cases I try my best to shape my modules in a way that it does not require circular imports. In the following article I discovered another way to overcome circular imports that I could not have think about simply by defering imported names lookup.Three Laws of Software Complexity
Lot of people think that building new softwares is complex. Actually, maintaining software is a lot more difficult than that. Just as for our universe, the entropy of all ours systems tend to increase more and more over time and thus, its complexity. This is where lies the challenge of our developers/ingeneers job.
read moreThe first software jobs AI will replace are...
An interesting short video of Dave Farley, interviewing Birgitta Böckeler, and discussing which software related jobs A.I may replace first. The interesting point is that both have a different opinion, what is your?
read moreSoftware needs to be more expensive
In this article the author make an interesting statement: most companies actively use open source code for free to create products for making profit. Read this article to discover why this should change and how.
read moreDon't use Python's property (for bad reasons)
I recently stumbled upon a code from one of my coworker who is rather new to Python. He is coming from a Java/Scala background and used python's
read moreproperty
decorator to mimic Java Getters/Setters. Let's see why you should not do this.