utils
run_sync ¶
Run an async function synchronously.
Source code in src/pixel_client/utils.py
15 16 17 18 19 20 21 22 | |
iter_over_async ¶
iter_over_async(
async_gen: AsyncGenerator[T, None],
) -> Iterator[T]
Iterate over an async generator synchronously.
Source code in src/pixel_client/utils.py
25 26 27 28 29 30 31 32 33 34 | |
chunks ¶
Yield successive n-sized chunks from lst.
Source code in src/pixel_client/utils.py
37 38 39 40 | |
silence_logger ¶
Temporarily disable a logger.
Source code in src/pixel_client/utils.py
43 44 45 46 47 48 49 50 51 52 53 | |
calculate_md5_base64_from_file ¶
Calculate the MD5 hash of a file and return it as a base64 encoded string.
Source code in src/pixel_client/utils.py
56 57 58 59 60 61 | |
calculate_md5_base64 ¶
Calculate the MD5 hash of a byte string and return it as a base64 encoded string.
Source code in src/pixel_client/utils.py
64 65 66 67 68 | |
iter_file_parts ¶
Iterate over a file in parts. Each part is a tuple of the part size, the MD5 hash of the part, and the part itself.
Source code in src/pixel_client/utils.py
71 72 73 74 75 76 77 78 79 80 81 82 | |
download_from_url ¶
Download a file from a URL and write it to a file-like object.
Source code in src/pixel_client/utils.py
85 86 87 88 89 90 91 | |