utils
run_sync ¶
Run an async function synchronously.
Source code in src/pixel_client/utils.py
36 37 38 39 40 41 42 | |
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
45 46 47 48 49 50 51 52 53 54 | |
chunks ¶
Yield successive n-sized chunks from lst.
Source code in src/pixel_client/utils.py
57 58 59 60 | |
silence_logger ¶
Temporarily disable a logger.
Source code in src/pixel_client/utils.py
63 64 65 66 67 68 69 70 71 72 73 | |
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
76 77 78 79 80 81 | |
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
84 85 86 87 88 | |
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
91 92 93 94 95 96 97 98 99 100 101 102 | |
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
105 106 107 108 109 110 111 | |