svcs: A Flexible Service Locator

Greetings, I’m very happy to announce that the first stable version 23.20.0 of my svcs (read: services) package is up on PyPI: https://pypi.org/project/svcs/ I have spent the past months trial-and-erroring, talking to everybody who wouldn't run away, and writing docs. So many docs. I’ve put that effort into it because I find it life-changing for writing web applications and I REALLY want y’all understand WHY. When talking to people, two patterns repeated themselves: 1. The average company has 3.5 half-baked implementations of svcs. 2. People either get very excited or very indifferent. The pattern it implements is called a service locator, but in most cases it’s just a convenient abstraction for plucking runtime-dependencies (correctly: SERVICES) from request objects + lifecycle features like instantiation/cleanups + introspection + better testability. While implementing it, I've also noticed how incredibly muddy and overloaded the vernacular around these topics is (c.f. “services”), so I've spent at least as much time writing a glossary as I've spent writing code: https://svcs.hynek.me/en/latest/glossary.html It comes with integration for AIOHTTP, FastAPI, Flask, Pyramid, and Starlette and it’s very easy to integrate with others. As you’d expect from a modern Python package, it has (optional) first-class support for static typing as well as asyncio. It’s been a very long time since I got this excited about a project of mine, but that excitement comes with anxiety and endless obsessing to the point that my friends started ghosting me which I take for the signal that it's time. So if this has piqued your interest, here are more details: https://svcs.hynek.me/en/latest/why.html
participants (1)
-
Hynek Schlawack