-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
136 lines (89 loc) · 3.7 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Bing Images - unofficial API
BingImages is a python packages which lets you easily search for images online using the bing images search engine. BingImages offers you the following cool features:
- Search for images like you would using any search engine
- Filter your search results with detailed filters
- Download all images to your local disk
## How to get it
To get BingImages, you can simply use pip:
```sh
pip install BingImages
```
Or you can clone [this](https://github.com/joelbarmettlerUZH/BingImages) repository and copy-paste all files contained in the *BingImages* folder into your project directory.
## Usage
BingImages is deadly simple. Let's have a look at the most important features:
### Simple search
To quickly search for images regarding one specific topic, just write the following line of code:
```python
from BingImages import BingImages
musk = BingImages("Elon Musk").get()
```
The musk variable now contains a set of 35 links that fit the serachterm "Elon Musk" best.
### Filter results
You can do more advanced searches by filtering your search-request:
#### Number of Images
Only returns the first X images from the search result.
```python
musk = BingImages("Elon Musk", count=5).get()
```
Possible attributes: **Any number you'd like**.
#### Image Color
Only returns images whose primary color is the specified color.
```python
musk = BingImages("Elon Musk", color="red").get()
```
Possible attributes: **yellow, orange, green, red, teal, black, white, grey, blue, purple, pink, brown, gray**.
#### Image Size
Only returns images of a certain Size
```python
musk = BingImages("Elon Musk", size="small").get()
```
Possible attributes: **small, medium, large, wallpaper**.
#### Image Type
Only returns images of a certain Type
```python
musk = BingImages("Elon Musk", type="photo").get()
```
Possible attributes: **photo, clipart, linedrawing, animatedgif, transparent**.
#### Image Layout
Only returns images of a certain Layout
```python
musk = BingImages("Elon Musk", layout="square").get()
```
Possible attributes: **square, wide, tall**.
#### Image Person
Only returns images of a certain Layout
```python
musk = BingImages("Elon Musk", person="portrait").get()
```
Possible attributes: **face, portrait**.
#### Image Age
Only returns images that were taken during in the specified timeperiod.
```python
musk = BingImages("Elon Musk", age="day").get()
```
Possible attributes: **day, week, month, year**.
#### Image License
Only returns images that fall under the specified license.
```python
musk = BingImages("Elon Musk", licensetype="publicDomain").get()
```
Possible attributes: **creativeCommons, publicDomain**.
License
----
MIT License
Copyright (c) 2018 Joel Barmettler
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.