Giter VIP home page Giter VIP logo

pixabay-downloader's Introduction

Pixabay mass-image downloader

Pulls images from Pixabay based on a search term, then saves them to a local folder (along with credits).

Setup

  1. Install Python 3.6 or higher
  2. Run pip install -r requirements.txt
  3. Copy the ./config/.env.example file to ./config/.env
  4. Add your Pixabay API key to the PIXABAY_API_KEY variable in ./config/.env

Usage

search.py

Get an idea of how many images a download will pull, for a specific search term. Note the maximum number of images returned via the API is 500 (even if there are thousands of results on the site).

python search.py

"Image search term: " landcapes at night
"Image orientation > [a]ll, [h]orizontal, [v]ertical:" h
"Image type > [a]ll, [p]hoto, [i]llustration, [v]ector:" p
"Narrow by image category (optional):" nature
"Minimum image width (optional):" 1920
"Minimum image height (optional):" 1080 

Result:

Found 162 images

download.py

Downloads images from Pixabay and saves them to the ./data/{search-term} folder (eg, ./data/landcapes-at-night).

python download.py

"Image search term: " landcapes at night
"Image orientation > [a]ll, [h]orizontal, [v]ertical:" h
"Image type > [a]ll, [p]hoto, [i]llustration, [v]ector:" p
"Narrow by image category (optional):" nature
"Minimum image width (optional):" 1920
"Minimum image height (optional):" 1080 

Result

Collecting image data from Pixabay...
 - Page 1 collected
 - Page 2 collected
 - Page 3 collected

Downloading individual images...
 - Saved hd-wallpaper-nature-wallpaper-ocean-3605547.jpg
 - Saved aurora-northern-lights-1197753.jpg
 - Saved wolf-moon-tree-silhouettes-howl-647528.jpg
 - Saved forest-fog-woods-trees-mystical-3394066.jpg
 - Saved night-forest-glowworm-light-3078326.jpg 
 [...]
 - Saved birds-little-birds-animals-2037456.png
 - Saved nebula-milky-way-night-sky-stars-2785204.jpg
 - Saved halloween-witch-spell-bats-2033906.png
 - Saved hd-wallpaper-nature-wallpaper-tree-1551106.jpg

Downloads completed

Along with the images, a __credits.csv file is also saved to the folder, containing the image credits; and a __results.json file, containing the raw API image information.

Categories

The following categories are available via the Pixabay API:

  • backgrounds
  • fashion
  • nature
  • science
  • education
  • feelings
  • health
  • people
  • religion
  • places
  • animals
  • industry
  • computer
  • food
  • sports
  • transportation
  • travel
  • buildings
  • business
  • music

Colors

The following colors are available via the Pixabay API:

  • grayscale
  • transparent
  • red
  • orange
  • yellow
  • green
  • turquoise
  • blue
  • lilac
  • pink
  • white
  • gray
  • black
  • brown

Personal Notes

This is a personal tool that I thought might be helpful. It's not meant to be a full-featured application, but rather a simple script that can be used to download images from Pixabay. Pull requests are welcome, but I'm not actively maintaining this project.

Please also note, that while I am a Software Engineer, I'm not a Python-focused Software Engineer in any way (most of what I do is focused around WordPress. I'm sure there are better ways to do things, and constructive feedback is welcome (especially when it comes to structuring the project).

Thanks for checking it out :)

pixabay-downloader's People

Contributors

danmenzies avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.