How to Lock a Function Across Processes with a Decorator in Python

Sometimes several processes can call the same function at once, even though its logic is completely unsuited to that. One worker changes the password for an external system, another does exactly the same thing, and a third is trying to log in. Everyone meant well, but now nobody knows the current password XD. A similar problem comes up when refreshing shared data, generating the same report, or modifying a file. If these operations get in each other’s way, we get a classic race condition: a race where the winner sometimes turns out to be an error message. ...

October 8, 2026 · 6 min · SpaceShaman

How to Add Logging Without Cluttering Your Code

In one of my Python projects, I needed to create fairly detailed logs describing the program’s execution. Most of the project is glue code that uses numerous external services and automates processes that were previously performed manually. I do not have full control over them, and my knowledge of how they work is very limited. Because different processes often use the same services, I wrapped those services in classes. The code implementing one of these automations looks roughly like this: ...

August 27, 2026 · 7 min · SpaceShaman

Evolving UserHarbor: From a Framework-Agnostic Core to Executable Storage Contracts

User management is one of those problems that rarely feels difficult enough to deserve much attention. Until you implement it for the fifth time. Registration, login, sessions, email verification, password resets, password changes, account deletion, roles, and permissions are not particularly unusual features. But almost every application needs some combination of them, and the implementation often ends up tightly coupled to whatever framework, ORM, or infrastructure the project happened to use at the time. ...

August 17, 2026 · 9 min · SpaceShaman

I built UserHarbor — a framework-agnostic user management library for Python

While working on a SaaS application recently, I once again had to implement the same user account flow: registration login sessions email verification password reset password change account deletion basic roles and permissions None of that was especially hard. But it was repetitive. I had written similar code before, and I did not want to keep rebuilding the same user-management boilerplate in every new Python project. So I started working on UserHarbor. ...

July 1, 2026 · 5 min · SpaceShaman