Metadata-Version: 2.1
Name: download_images_1
Version: 0.0.1
Summary: A simple package to download images from URLs.
Author: Donut Anti
Author-email: donutanti@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: DateTime (>=5.5,<6.0)
Requires-Dist: Pillow (>=9.5.0,<10.0.0)
Requires-Dist: requests (>=2.32.3,<3.0.0)
Requires-Dist: tqdm (>=4.66.4,<5.0.0)
Description-Content-Type: text/markdown

# 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:
```bash
pip install download_images_1
```
## Usage
### Basic Usage
```python
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
```python
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

