pyee
aiometer
pyee | aiometer | |
---|---|---|
1 | 2 | |
343 | 337 | |
- | - | |
7.1 | 4.2 | |
about 1 month ago | 5 months ago | |
Python | Python | |
MIT License | 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.
pyee
-
pyee Release 9.0: Type Annotations, New APIs & More!
I just published a fresh release of pyee and boy does it have a lot of changes from the last *counts on fingers* 5 months! I wanted to talk about the changes and what went into them, as some of them are fun and interesting.
aiometer
-
HTTP Rate Limit
class RateLimitTransport(httpx.AsyncHTTPTransport): def __init__(self, max_per_second: float = 5, **kwargs) -> None: """ Async HTTP transport with rate limit. Args: max_per_second: Maximum number of requests per second. Other args are passed to httpx.AsyncHTTPTransport. """ self.interval = 1 / max_per_second self.next_start_time = 0 super().__init__(**kwargs) async def notify_task_start(self): """ https://github.com/florimondmanca/aiometer/blob/358976e0b60bce29b9fe8c59807fafbad3e62cbc/src/aiometer/_impl/meters.py#L57 """ loop = asyncio.get_running_loop() while True: now = loop.time() next_start_time = max(self.next_start_time, now) until_now = next_start_time - now if until_now <= self.interval: break await asyncio.sleep(max(0, until_now - self.interval)) self.next_start_time = max(self.next_start_time, now) + self.interval async def handle_async_request(self, request: httpx.Request) -> httpx.Response: await self.notify_task_start() return await super().handle_async_request(request) async def __aenter__(self) -> Self: await self.notify_task_start() return await super().__aenter__() async def __aexit__(self, *args: Any) -> None: await super().__aexit__(*args)
-
Limiting concurrency in Python asyncio: the story of async imap_unordered()
I recommend anyone interested in this topic to take a look at aiometer.
What are some alternatives?
pyright - Static Type Checker for Python
httpx - A next generation HTTP client for Python. 🦋
EventEmitter2 - A nodejs event emitter implementation with namespaces, wildcards, TTL, works in the browser
asyncer - Asyncer, async and await, focused on developer experience.
DefinitelyTyped - The repository for high quality TypeScript type definitions.
trio - Trio – a friendly Python library for async concurrency and I/O
neovim - Vim-fork focused on extensibility and usability
fastapi-azure-auth - Easy and secure implementation of Azure Entra ID (previously AD) for your FastAPI APIs 🔒 B2C, single- and multi-tenant support.
coc-pyright - Pyright extension for coc.nvim
ratelimit-headers - Repository for IETF WG draft ratelimit-headers
pg-purepy - Pure-python structurally concurrent PostgreSQL driver
coc.nvim - Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.