World class stuff.
I found Will’s codebase easy to read and reason about, making it easy to help extend.
FastAPI-Azure-Auth [0] is a library to do authentication and authorization through Azure AD using tokens.
ASGI—Correlation-ID[1] is a package that utilizes contextvars to store information through the asyncio stack, in order to attach correlation/request ID to every log message from a request. Django-GUID [2] does the same for both sync and async Django.
Pydantic-factories [3] is an awesome library to mock data for your pydantic models.
[0] https://github.com/Intility/fastapi-azure-auth
[1] https://github.com/snok/asgi-correlation-id
Really, django is the framework to read if you are into Python.
The other is Tornado. https://github.com/tornadoweb/tornado
- PDM: A modern Python package manager with PEP 582 support[1]
- Spleeter: Deezer source separation library including pretrained models[2]
---
- 100% test coverage (with some typical exceptions like `if __name__ == "__main__":` blocks)
- Randomises test sequence and inputs reproducibly
- Passes Pylint with max McCabe complexity of 6
- Passes `mypy --strict`
- Formatted using Black and isort
It is an incredibly complex piece of code, but is immensely rigidly structured, typed and makes heavy use of OO to remain readable and manageable.
So instead of perfect hypothetical textbook code, I think this is a very instructive realistic project.
The code is tested & known to work well
Really any recent project by Encode: https://github.com/encode
Source code is not to be read like a book. If you read it, you must do so with a goal, context and purpose.