Skip to content

Instantly share code, notes, and snippets.

View Prabal-verma's full-sized avatar
:shipit:
Focusing

Prabal Verma Prabal-verma

:shipit:
Focusing
View GitHub Profile
#!/usr/bin/env python3
"""
Download images from a CSV/TSV file containing at least two columns:
- sample_id: unique identifier for each row
- image_link: HTTP(S) URL to the image
Images are saved using the sample_id as the filename. The script preserves the
file extension from the URL when possible, otherwise infers from the response's
Content-Type header and defaults to .jpg as a last resort.