A simple package to download images from URLs.
Project description
Image Downloader
A Python package to download images from given URLs and save them with unique filenames. This package is especially useful for batch downloading and saving images while avoiding filename conflicts.
Features
- Downloads images from a list of URLs.
- Saves images to a specified directory.
- Ensures unique filenames using timestamps.
- Handles filename conflicts interactively.
- Displays progress using a dynamic progress bar in Jupyter Notebook.
Installation
You can install the package using pip:
pip install download_images_1
Usage
Basic Usage
from download_images_1 import download_images
# List of image URLs
urls = [
'https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg?auto=compress&cs=tinysrgb&w=1440',
'https://images.pexels.com/photos/104827/cat-pet-animal-domestic-104827.jpeg?auto=compress&cs=tinysrgb&w=1440'
]
# Destination directory
destination_directory = 'data/cat'
# Base name for the images
image_name = 'cat'
# Download images
download_images(urls, destination_directory, image_name)
Handling Filename Conflicts
If a file with the same name already exists, you will be prompted to either skip the file, modify the filename, or use a unique timestamp.
Example usage
urls = [
'https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg?auto=compress&cs=tinysrgb&w=1440',
'https://images.pexels.com/photos/104827/cat-pet-animal-domestic-104827.jpeg?auto=compress&cs=tinysrgb&w=1440'
]
destination_directory = 'data/cat' # Use a relative path for compatibility
image_name = 'cat'
download_images(urls, destination_directory, image_name)
%ls
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file download_images_1-0.0.1.tar.gz.
File metadata
- Download URL: download_images_1-0.0.1.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.13 Linux/5.15.133+
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b646aadd65b19500b84ec2be556b38bf63e6fcb8ea3fad7e12363fd287754e7
|
|
| MD5 |
22187b63ecaffb8f06514396980c83d4
|
|
| BLAKE2b-256 |
8cd19ac7d94d4b07facdff0d55212765ba2a3fe79dd74ad43d693f1111b54640
|
File details
Details for the file download_images_1-0.0.1-py3-none-any.whl.
File metadata
- Download URL: download_images_1-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.13 Linux/5.15.133+
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73d2bbd8c99510ca5cad4456300dfa0e31cf76092c3fb8c133e986c90c2608e4
|
|
| MD5 |
e41edf33926a575f4b174cbf03f5e03a
|
|
| BLAKE2b-256 |
19140aec5d9416559c9416a42e2d827cf9be141965b1d32fb22067240bde8099
|