Go to file
Daniil Fajnberg bc212ef002 callback `log_failed_attempt` added 2022-01-26 11:00:29 +01:00
src/webutils_df callback `log_failed_attempt` added 2022-01-26 11:00:29 +01:00
.gitignore ignore distribution package directory 2021-11-27 12:32:51 +01:00
LICENSE renamed the package for import purposes 2022-01-26 09:29:58 +01:00
README.md callback `log_failed_attempt` added 2022-01-26 11:00:29 +01:00
pyproject.toml initial commit 2021-11-27 11:56:15 +01:00
requirements.txt initial commit 2021-11-27 11:56:15 +01:00
setup.cfg callback `log_failed_attempt` added 2022-01-26 11:00:29 +01:00

README.md

Miscellaneous web utilities

Stuff I frequently use in various unrelated projects that deal with web requests.

Functions

gather_in_batches

Makes it more convenient to run awaitable objects in concurrent batches.

log_failed_attempt

Prototypical callback argument for the attempt decorator.

Decorators

@in_async_session

Handles starting and closing of a temporary aiohttp.ClientSession instance around any async function that makes use of such an object to perform requests.

@attempt

Allows defining for an async function to be called repeatedly if it throws a specific kind of exception.

Building

Clone this repo, install build via pip, then run python -m build from the repository's root directory. This should produce a dist/ subdirectory with a wheel (build) and archive (source) distribution.

The resulting whl-file can be installed in the environment of choice via pip install <path>/dist/***.whl.