repology_client.utils#

Utility functions and classes.

class repology_client.utils.limit(calls: int, period: float)#

Bases: object

Decorator to set a limit on requests per second.

Based on this StackOverflow answer.

repology_client.utils.ensure_session(session: ClientSession | None = None) AsyncGenerator[ClientSession, None]#

Create a new client session, if necessary, and close it on exit.

Parameters:

sessionaiohttp client session