From 2a36d931b675d391f3d77c6107ee53918ef7a5c8 Mon Sep 17 00:00:00 2001 From: Jakub Miazek Date: Wed, 8 May 2024 15:32:28 +0200 Subject: [PATCH 1/3] update README.md --- README.md | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index bb4d9d8..bef540f 100644 --- a/README.md +++ b/README.md @@ -37,22 +37,27 @@ [//]: # (TODO: Usage,Roadmap, Contributing, License, Contact) - - - - ## About The Project -Example of [FastAPI](https://fastapi.tiangolo.com/) integration supported by almighty [Pydantic 2.0](https://github.com/pydantic/pydantic) -with [SQLAlchemy ORM](https://www.sqlalchemy.org/) and PostgreSQL16 -connected via fastest Database Client Library for python/asyncio [asyncpg](https://github.com/MagicStack/asyncpg). +This example demonstrates the seamless integration of [FastAPI](https://fastapi.tiangolo.com/), a modern, high-performance web framework, +with [Pydantic 2.0](https://github.com/pydantic/pydantic), a robust and powerful data validation library. +The integration is further enhanced by the use of [SQLAlchemy ORM](https://www.sqlalchemy.org/), a popular and feature-rich Object-Relational Mapping tool, +and [PostgreSQL16](https://www.postgresql.org/about/news/postgresql-16-released-2715/) relational database. + +The entire stack is connected using the [asyncpg](https://github.com/MagicStack/asyncpg) Database Client Library, +which provides a robust and efficient way to interact with PostgreSQL databases in Python, +leveraging the power of asyncio and event loops. + +Notably, this example showcases the latest and greatest versions of SQLAlchemy and psycopg, +which are renowned for their robustness, power, and speed. The inclusion of FastAPI adds a modern, fast, and high-performance web framework to the mix +allowing for the rapid development of APIs with Python 3.8+. + +FastAPI has received significant recognition in the industry, including a review on thoughtworks Technology Radar in April 2021, +where it was classified as a Trial technology, with comments praising its performance, ease of use, +and features such as API documentation using OpenAPI. Additionally, FastAPI was recognized in the Python Developers Survey 2022 Results, +conducted by the Python Software Foundation and JetBrains, where it was reported that 1 in 4 Python developers use FastAPI, +with a 4 percentage point increase from the previous year. -Beside of using latest and greatest version of [SQLAlchemy](https://www.sqlalchemy.org/) with it robustness, powerfulness and speed -of [asyncpg](https://github.com/MagicStack/asyncpg) there is [FastAPI](https://fastapi.tiangolo.com/) (modern, fast (high-performance), -web framework for building APIs with Python 3.8+ based on standard Python type hints.) already reviewed -on [thoughtworks](https://www.thoughtworks.com/radar/languages-and-frameworks?blipid=202104087) and noted in -Python Developers [Survey 2021 Results](https://lp.jetbrains.com/python-developers-survey-2021/#FrameworksLibraries) -as the fifth official annual Python Developers Survey, conducted as a collaborative effort between the Python Software Foundation and JetBrains. ### Built With [![FastAPI][fastapi.tiangolo.com]][fastapi-url] @@ -181,11 +186,11 @@ I've included a few of my favorites to kick things off! [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555 [linkedin-url]: https://www.linkedin.com/in/python-has-powers/ -[fastapi.tiangolo.com]: https://img.shields.io/badge/FastAPI-0.110.0-009485?style=for-the-badge&logo=fastapi&logoColor=white +[fastapi.tiangolo.com]: https://img.shields.io/badge/FastAPI-0.111.0-009485?style=for-the-badge&logo=fastapi&logoColor=white [fastapi-url]: https://fastapi.tiangolo.com/ -[pydantic.com]: https://img.shields.io/badge/Pydantic-2.6.4-e92063?style=for-the-badge&logo=pydantic&logoColor=white +[pydantic.com]: https://img.shields.io/badge/Pydantic-2.7.1-e92063?style=for-the-badge&logo=pydantic&logoColor=white [pydantic-url]: https://docs.pydantic.dev/latest/ -[sqlalchemy.org]: https://img.shields.io/badge/SQLAlchemy-2.0.28-bb0000?color=bb0000&style=for-the-badge +[sqlalchemy.org]: https://img.shields.io/badge/SQLAlchemy-2.0.30-bb0000?color=bb0000&style=for-the-badge [sqlalchemy-url]: https://docs.sqlalchemy.org/en/20/ [uvicorn.org]: https://img.shields.io/badge/Uvicorn-0.29.0-2094f3?style=for-the-badge&logo=uvicorn&logoColor=white [uvicorn-url]: https://www.uvicorn.org/ @@ -198,5 +203,5 @@ I've included a few of my favorites to kick things off! [rich.readthedocs.io]: https://img.shields.io/badge/rich-13.7.1-009485?style=for-the-badge&logo=rich&logoColor=white [rich-url]: https://rich.readthedocs.io/en/latest/ -[redis.io]: https://img.shields.io/badge/redis-5.0.3-dc382d?style=for-the-badge&logo=redis&logoColor=white +[redis.io]: https://img.shields.io/badge/redis-5.0.4-dc382d?style=for-the-badge&logo=redis&logoColor=white [redis-url]: https://redis.io/ From bf85c3a2a45b728eba48d92e8c9f5becd67bb00d Mon Sep 17 00:00:00 2001 From: Jakub Miazek Date: Wed, 8 May 2024 15:35:45 +0200 Subject: [PATCH 2/3] eanble "rich_tracebacks": True for logger config.ini --- config.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config.ini b/config.ini index c40c808..da1e6db 100644 --- a/config.ini +++ b/config.ini @@ -26,20 +26,20 @@ qualname = uvicorn.access [handler_stream] class = app.utils.logging.RichConsoleHandler -kwargs = {"omit_repeated_times":True, "show_time": False, "enable_link_path": False, "tracebacks_show_locals": True} +kwargs = {"omit_repeated_times":True, "show_time": False, "enable_link_path": False, "tracebacks_show_locals": True, "rich_tracebacks": True} args = (100, "white") formatter = default stream = ext://sys.stdout [handler_sqlalchemy] class = app.utils.logging.RichConsoleHandler -kwargs = {"omit_repeated_times":True, "show_time": False, "enable_link_path": False, "tracebacks_show_locals": True} +kwargs = {"omit_repeated_times":True, "show_time": False, "enable_link_path": False, "tracebacks_show_locals": True, "rich_tracebacks": True} args = (100, "magenta") formatter = default [handler_uvicorn] class = app.utils.logging.RichConsoleHandler -kwargs = {"omit_repeated_times":True, "show_time": False, "enable_link_path": False, "tracebacks_show_locals": True} +kwargs = {"omit_repeated_times":True, "show_time": False, "enable_link_path": False, "tracebacks_show_locals": True, "rich_tracebacks": True} args = (100, "yellow") formatter = default From bbe01f7486b7179ed9807e03ef86b615965368f7 Mon Sep 17 00:00:00 2001 From: Jakub Miazek Date: Wed, 8 May 2024 15:38:06 +0200 Subject: [PATCH 3/3] eanble "rich_tracebacks": True for logger config.ini --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bef540f..b7f25e7 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ I've included a few of my favorites to kick things off! * [SQL Code Generator](https://github.com/agronholm/sqlacodegen) * [Passlib - password hashing library for Python](https://passlib.readthedocs.io/en/stable/) * [Polars - fast DataFrame library for Rust and Python](https://docs.pola.rs/) +* [Rich - Traceback and logging, made easy](https://rich.readthedocs.io/en/stable/traceback.html)

(back to top)