Skip to content

Instantly share code, notes, and snippets.

View powerpellet1077's full-sized avatar
๐Ÿ
making spaghetti code

powerpellet1077

๐Ÿ
making spaghetti code
View GitHub Profile
@tyhoff
tyhoff / progress_bar_requests_upload.py
Last active February 3, 2026 23:18
Python requests HTTP PUT with tqdm progress bar
from tqdm import tqdm
from tqdm.utils import CallbackIOWrapper
file_path = os.path.abspath(__file__)
upload_url = https://some-bucket.s3.amazonaws.com
file_size = os.stat(file_path).st_size
with open(file_path, "rb") as f:
with tqdm(total=file_size, unit="B", unit_scale=True, unit_divisor=1024) as t:
wrapped_file = CallbackIOWrapper(t.update, f, "read")