Ubuntu-Inspired Python Project: Mindfully Collecting Images from the Web
This tool is inspired by the Ubuntu philosophy: "I am because we are." It allows you to fetch images from the web and organize them, showing respect for the global online community by handling errors gracefully and avoiding duplicates.
- Community: Connects to the wider web to collect shared images.
- Respect: Handles errors and respects the network and file system.
- Sharing: Organizes images for easy access and sharing.
- Practicality: A useful script for organizing images from URLs.
- Download a single image from a URL and save it to the
Fetched_Imagesdirectory. - Graceful error handling for network and file issues.
- Avoids duplicate downloads.
- Handles multiple URLs (challenge).
- Basic security checks before downloading files (challenge).
- Checks important HTTP headers (challenge).
- Python 3.x
requestslibrary
Install requirements (if needed):
pip install requestsRun the script:
python ubuntu_image_fetcher.pyFollow the prompts to enter one or more image URLs.
Welcome to the Ubuntu Image Fetcher
A tool for mindfully collecting images from the web
Please enter image URLs (comma-separated): https://example.com/image1.jpg, https://example.com/image2.png
✓ Successfully fetched: image1.jpg
✓ Image saved to Fetched_Images/image1.jpg
✓ Successfully fetched: image2.png
✓ Image saved to Fetched_Images/image2.png
Connection strengthened. Community enriched.
- Community: Connects to the web.
- Respect: Handles errors, avoids duplicates, checks headers.
- Sharing: Images organized for easy sharing.
- Practicality: Real-world usefulness.
See code comments for additional challenge solutions.
A person is a person through other persons. — Ubuntu philosophy