A Python library designed for quick search and downloading images.
Project description
Quick Tutorial
>>> from imagesoup import ImageSoup
>>>
>>> soup = ImageSoup()
>>> images = soup.search('"Arya Stark"', n_images=10)
>>>
>>> arya = images[0]
>>> arya.URL
'https://upload.wikimedia.org/wikipedia/en/3/39/Arya_Stark-Maisie_Williams.jpg'
>>> arya.show()
>>> arya.size
(300, 404)
>>> arya.dpi
(72, 72)
>>> arya.color_count
7269
>>> arya.main_color(n=2)
[('black', 0.6219224422442244), ('darkslategrey', 0.27796204620462045)]
>>> arya.to_file('arya.jpg')
Installation
To install ImageSoup, simply use pip:
$ pip install imagesoup
Advanced Search
- image_size: string, tuple(width, height)
Find images in any size you need.
(width, height)
icon
medium
large
400x300+
640x480+
800x600+
1024x768+
2mp+
4mp+
8mp+
10mp+
12mp+
15mp+
20mp+
40mp+
70mp+
- aspect_ratio: string
Specify the shape of images.
tall
square
wide
panoramic
>>> from imagesoup import ImageSoup
>>>
>>> soup = ImageSoup()
>>> images = soup.search('Cersei Lannister', image_size='icon', aspect_ratio='square')
>>>
>>> im = images[0]
>>> im.URL
'http://cdn.images.express.co.uk/img/dynamic/galleries/64x64/264415.jpg'
>>> im.size
(64, 64)
>>> im.show()
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
imagesoup-0.1.0.tar.gz
(6.0 kB
view details)
File details
Details for the file imagesoup-0.1.0.tar.gz
.
File metadata
- Download URL: imagesoup-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1aad684e4697f894256664757ea12ee32f61b40ef9ee914c14ff556ee1d101f |
|
MD5 | b632d998292c5416551055bf9f47a706 |
|
BLAKE2b-256 | 23b8eb07c872c7ff29382ac3e6b33b38584151e2420d1020ecca7ab0e247214e |