> Tag: Python

How to profile a FastAPI asynchronous request

In this article, I share the challenges I faced when trying to profile requests in an asynchronous FastAPI server. The traditional profiler, cProfile, provided inaccurate results due to the nature of asynchronous functions, which resulted in misleading statistics. To overcome this, I explored pyinstrument, a statistical profiler with built-in support for asynchronous Python code.

Generating pretty maps ready to be gift-wrapped

Lyon, FranceI have been toying with the idea of generating visually pleasing maps centered on a given address, to have them printed and framed. The way I see it, it would make an original and personalised gift for the person living there. So when Marcelo de Oliveira Rosa Prates' prettymaps blew up on Reddit, I decided to try it.

Speeding up a 21h job to 8 minutes: a story of SQLAlchemy optimization

In this article published on the Alan tech blog, we explain how my team has reduced the runtime of our longest nightly job from 21h to about 8 minutes, by using simple profiling and SQLAlchemy optimizations.

My DIY Dungeons and Dragons ambiance mixer

I find that an immersive sound ambiance is key to helping tabletop RPG players engage. It can increase their stress and sense of urgency during a fight, galvanize them during a harrowing speech, or break their heart when they realize they've just lost something and there's no getting it back. In that article, I will walk you through the design of my fully DIY sound mixer, inspired by the Launchpad, allowing me to create a great sound ambiance at the table.

Cleaning up the Dungeondraft tag list

I have spent quite a lot of time using Dungeondraft recently, as I've designed many homebrewed places and encounters. The more maps I created, the more assets pack I bought from CartographyAssets, to further enrich and improve them. I quickly started to realize that some of these asset packs caused the tag list to be filled with entries that weren't linked to any assets at all. This made the asset discovery process quite frustrating.

Celery best practices

I've been programming with celery for the last three years, and Deni Bertović's article about Celery best practices has truly been invaluable to me. In time, I've also come up with my set of best practices, and I guess this blog is as good a place as any to …

Crawl a website with scrapy

In this article, we are going to see how to scrape information from a website, in particular, from all pages with a common URL pattern. We will see how to do that with Scrapy, a very powerful, and yet simple, scraping and web-crawling framework.

For example, you might be interested …

Create a webcam manager using pyGTK and Gstreamer

Introduction

I recently joined the Strongsteam project for a 6 month internship. Our main goal is to provide some "artificial intelligence and data mining APIs to let you pull interesting information out of images, video and audio." We will be doing a presentation at Pycon 2012, the 9th of March …

How to randomly generate a Monty Python parody

If you always wanted to write texts in the way of Monty Python, I have what you need ! In this post, I am going to show you mathematical techniques to analyse a text, in order to randomly generate look-alike texts.

Introduction to basic concepts

First essential question: what is a …