webutils-df/README.md

30 lines
959 B
Markdown
Raw Permalink Normal View History

2021-11-27 11:56:15 +01:00
# Miscellaneous web utilities
2021-11-28 19:55:27 +01:00
Stuff I frequently use in various unrelated projects that deal with web requests.
2021-11-30 15:20:27 +01:00
## Functions
### gather_in_batches
Makes it more convenient to run awaitable objects in concurrent batches.
2022-01-26 11:00:29 +01:00
### log_failed_attempt
Prototypical `callback` argument for the `attempt` decorator.
2021-11-28 19:55:27 +01:00
## Decorators
2022-01-26 09:23:36 +01:00
### @in_async_session
2021-11-28 19:55:27 +01:00
Handles starting and closing of a temporary `aiohttp.ClientSession` instance around any async function that makes use of such an object to perform requests.
2022-01-26 09:23:36 +01:00
### @attempt
Allows defining for an async function to be called repeatedly if it throws a specific kind of exception.
2021-11-28 19:55:27 +01:00
## 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`.