trio
fastapi
trio | fastapi | |
---|---|---|
19 | 468 | |
5,895 | 71,023 | |
1.1% | - | |
9.5 | 9.8 | |
3 days ago | 7 days ago | |
Python | Python | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
trio
-
trio VS awaits - a user suggested alternative
2 projects | 9 Dec 2023
-
In what ways are channels are better than the traditional await?
Incidentally, the alternative event loop implementation trio in python does not have "gather", you also need channels, and it's a deliberate design choice - there is some discussion about that in this ticket https://github.com/python-trio/trio/issues/2188
- Polyphony: Fine-Grained Concurrency for Ruby
-
This Week In Python
trio – a friendly Python library for async concurrency and I/O
-
Python projects with best practices on Github?
trio. the best code, the best documentation, awesome community.
- Trio: Structured Concurrency for Python
-
The Heisenbug lurking in your async code (Python)
I'll +1 the Trio shoutout [1], but it's worth emphasizing that the core concept of Trio (nurseries) now exists in the stdlib in the form of task groups [2]. The article mentions this very briefly, but it's easy to miss, and I wouldn't describe it as a solution to this bug, anyways. Rather, it's more of a different way of writing multitasking code, which happens to make this class of bug impossible.
[1] https://github.com/python-trio/trio
[2] https://docs.python.org/3/library/asyncio-task.html#task-gro...
-
The gotcha of unhandled promise rejections
It's similar to manual memory management.
Structured concurrency is one approach to solving this problem. In a structured concurrency a promise would not go out of scope unhandled. Not sure how you would add APIs for it though.
See Python's trio nurseries idea which uses a python context manager.
https://github.com/python-trio/trio
I'm working on a syntax for state machines and it could be used as a DSL for promises. It looks similar to a bash pipeline but it matches predicates similar to prolog.
In theory you could wire up a tree of structured concurrency with this DSL.
https://github.com/samsquire/ideas4#558-assign-location-mult...
-
Python Asyncio: The Complete Guide
Not complete - doesn't include Task Groups [1]
In fairness they were only included in asyncio as of Python 3.11, which was released a couple of weeks ago.
These were an idea originally from Trio [2] where they're called "nurseries" instead of "task groups". My view is that you're better off using Trio, or at least anyio [3] which gives a Trio-like interface to asyncio. One particularly nice thing about Trio (and anyio) is that there's no way to spawn background tasks except to use task groups i.e. there's no analogue of asyncio's create_task() function. That is good because it guarantees that no task is ever left accidentally running in the background and no exception left silently uncaught.
[1] https://docs.python.org/3/library/asyncio-task.html#task-gro...
[2] https://github.com/python-trio/trio
[3] https://anyio.readthedocs.io/en/latest/
- Anyone here able to help with a python issue?
fastapi
-
Python: A SQLAlchemy Wrapper Component That Works With Both Flask and FastAPI Frameworks
It has been an interesting exercise developing this wrapper component. The fact that it seamlessly integrates with the FastAPI framework is just a bonus for me; I didn't plan for it since I hadn't learned FastAPI at the time. I hope you find this post useful. Thank you for reading, and stay safe as always.
-
FastAPI Best Practices: A Condensed Guide with Examples
FastAPI is a modern, high-performance web framework for building APIs with Python, based on standard Python type hints.
-
Building an Email Assistant Application with Burr
In this tutorial, I will demonstrate how to use Burr, an open source framework (disclosure: I helped create it), using simple OpenAI client calls to GPT4, and FastAPI to create a custom email assistant agent. We’ll describe the challenge one faces and then how you can solve for them. For the application frontend we provide a reference implementation but won’t dive into details for it.
-
FastAPI Got Me an OpenAPI Spec Really... Fast
That’s when I found FastAPI.
-
How to Deploy a Fast API Application to a Kubernetes Cluster using Podman and Minikube
FastAPI & Uvicorn
-
Analysing FastAPI Middleware Performance
Discussion at FastAPI GitHub: https://github.com/tiangolo/fastapi/issues/2696
-
LangChain, Python, and Heroku
An API application framework (such as FastAPI)
-
Litestar – powerful, flexible, and highly performant Python ASGI framework
It’s been my experience that async Python frameworks tend to turn IO bound problems into CPU bound problems with a high enough request rate, because due to their nature they act as unbounded queues.
This ends up made worse if you’re using sync routes.
If you’re constrained on a resource such as a database connection pool, your framework will continue to pull http requests off the wire that a sane client will cancel and retry due to timeouts because it takes too long to get a connection out of the pool. Since there isn’t a straightforward way to cancel the execution of a route handler in every Python http framework I’ve seen exhibit this problem, the problem quickly snowballs.
This is an issue with fastapi, too- https://github.com/tiangolo/fastapi/issues/5759
-
AI-Powered Image Search with CLIP, pgvector, and Fast API
Fast API.
- Ask HN: What is your go-to stack for the web?
What are some alternatives?
uvloop - Ultra fast asyncio event loop.
AIOHTTP - Asynchronous HTTP client/server framework for asyncio and Python
curio - Good Curio!
HS-Sanic - Async Python 3.6+ web server/framework | Build fast. Run fast. [Moved to: https://github.com/sanic-org/sanic]
asyncio
Tornado - Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.
Twisted - Event-driven networking engine written in Python.
django-ninja - 💨 Fast, Async-ready, Openapi, type hints based framework for building APIs
LDAP3 - a strictly RFC 4510 conforming LDAP V3 pure Python client. The same codebase works with Python 2. Python 3, PyPy and PyPy3
Flask - The Python micro framework for building web applications.
DearPyGui - Dear PyGui: A fast and powerful Graphical User Interface Toolkit for Python with minimal dependencies
swagger-ui - Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.