Skip to main content

A module of downloading image from URL and resizing.

Project description

pyimgdown is a python module for downloading image using url and resizing.

Installation

pip install pyimgdown

Features

  • download image from url.

  • resize and attach thumbnail file suffix.

  • single url mode and file (url list file) mode.

  • specify download directory.

Usage

url

>>> import pyimgdown
>>> url = "https://localhost/test.jpeg"
>>> pyimgdown.download(url=url)
    ...
    => {'image': './PyImgDown/test.jpeg'}

file

>>> import pyimgdown
>>> pyimgdown.download(file="./url_list.txt")
...
    [
    {'image': u'./PyImgDown/test1.jpg'},
    {'image': u'./PyImgDown/test2.jpg'},
    {'image': u'./PyImgDown/test3.jpg'},
    {'image': u'./PyImgDown/test4.jpg'},
    {'image': u'./PyImgDown/test5.jpg'},
    {'image': u'./PyImgDown/test6.jpg'},
    {'image': u'./PyImgDown/test7.jpg'},
    {'image': u'./PyImgDown/test8.jpg'},
    {'image': u'./PyImgDown/test9.jpg'},
    {'image': u'.PyImgDown/test10.jpg'}
    ]

url+thumbnail

>>> pyimgdown.download(url="https://localhost/test.jpeg", thumbnail_size=(64,64))
    {
    'image': './PyImgDown/test.jpeg',
    'thumbnail': './PyImgDown/test_thumbnail.jpeg'
    }

url+thumbnail+download directory

>>> pyimgdown.download(url="https://localhost/test.jpeg", thumbnail_size=(64,64), download_dir="./download")
    {
    'image': './download/test.jpeg',
    'thumbnail': './download/test_thumbnail.jpeg'
    }

url+thumbnail+download directory+thumbnail_file_suffix

>>> pyimgdown.download(url="https://localhost/test.jpeg", thumbnail_size=(64,64), download_dir="./download", thumbnail_file_suffix="_thumb")
    {
    'image': './download/test.jpeg',
    'thumbnail': './download/test_thumb.jpeg'
    }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyimgdown-0.5.4.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file pyimgdown-0.5.4.tar.gz.

File metadata

  • Download URL: pyimgdown-0.5.4.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyimgdown-0.5.4.tar.gz
Algorithm Hash digest
SHA256 3a0f2a4f4cceba9231ffadfa8d2ee15fe8f5b83dc718c74f7bef91d394f4c18e
MD5 3c3657f2bb4d11b038fbf1daa47a9e48
BLAKE2b-256 e2b2d58d2c125362f5b2e42498c0af117c0b5b79af04e11b2767ad66479e8719

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page