Ben ShearlawAsynchronously stream response data to disc using PythonUsing the HTTPX and aiofiles libraries, a request can be made, and the response can be streamed asynchronously to disk using the following…Sep 13, 2023Sep 13, 2023
Ben ShearlawBest way to make Async Requests with FastAPI… the HTTPX Request Client & Tenacity!It's very common to need to make requests from your API to other APIs. For years, Python developers heavily favored the Requests HTTP…Jul 28, 20233Jul 28, 20233
Ben ShearlawLoad testing REST APIs with Python using LocustLocust An open-source load testing tool. It essentially allows you to send x amount of requests to your endpoints and will report back on…Jul 17, 2023Jul 17, 2023
Ben ShearlawIntegrating Sentry Application Performance Monitor into FastAPI Python Web FrameworkSentry is an excellent third-party service to track errors and monitor performance. Sentry also includes a free tier, which I find provides…Jul 12, 2023Jul 12, 2023
Ben ShearlawMy Software Development Setup as a Python EngineerI’ve used a range of different computers and software over the years, here is my shortlist.Jul 11, 20231Jul 11, 20231
Ben ShearlawCreate a Mock SQL DB in Python from CSV for unit testingSometimes having a mock database for unit testing can be very useful, especially in database-driven applications. A simple relational…Jul 1, 2023Jul 1, 2023
Ben ShearlawAsynchronous Postgres with Python, FastAPI, and Psycopg 3Use advanced features of the Psycopg 3 library such as asynchronous operations and connection pooling to achieve high availability and fast…Jul 1, 20231Jul 1, 20231