Git Product home page Git Product logo

pexels-scraper's Introduction

๐Ÿ–ผ๏ธ Pexels scraper

Current bundle version Docker Hub Code style Code style Security check

A python command-line tool for scraping images from Pexels.com by topic search.

Info

Pexels.com is a platform which provides royalty-free photos and videos.

๐Ÿงฐ Requirements

  • A Pexels API key (can be requested after sign-up)
  • Docker

Note: By default, the API is rate-limited to 200 requests per hour and 20,000 requests per month. Read the Pexels Guidelines for more info.

๐Ÿ‹ Usage

  1. Pull the image.
docker pull t0shy/pexels-scraper:latest
  1. Run it.

Supply a JSON payload to search for a specific category. For available query parameters, see the API documentation.

docker run -it --rm \
  -u $(id -u):$(id -g) \
  -v $(pwd)/pexels/results:/output \
  t0shy/pexels-scraper:latest \
  -k "37c01053e18949935e52c0e9ddabc706166de7ca42c8357f0f4bf93e" \
  -p '{"query":"Nature"}'

Note: make sure to mount to the /output directory on the container.

  1. Check the results.
|-- ./pexels/results
  |-- 7203981.jpeg
  |-- ...
  |-- 7758348.jpeg

Note: a filename consists of id and original file extension.

๐Ÿ™‹ Help

docker run -it --rm t0shy/pexels-scraper:latest -h
 _____              _         _____
|  __ \            | |       / ____|
| |__) |____  _____| |___   | (___   ___ _ __ __ _ _ __   ___ _ __
|  ___/ _ \ \/ / _ \ / __|   \___ \ / __| '__/ _` | '_ \ / _ \ '__|
| |  |  __/>  <  __/ \__ \   ____) | (__| | | (_| | |_) |  __/ |
|_|   \___/_/\_\___|_|___/  |_____/ \___|_|  \__,_| .__/ \___|_|
                                                  | |
                                                  |_|

usage: main.py [-h] -k API_KEY -p PAYLOAD [-d] [-v]

A python command-line tool for scraping images from Pexels.com by topic search.

options:
  -h, --help            show this help message and exit
  -k API_KEY, --key API_KEY
                        API key.
  -p PAYLOAD, --payload PAYLOAD
                        Payload in JSON format.
  -d, --debug           Debug loglevel; Fallback to WARNING.
  -v, --verbose         Info loglevel.

Repository: https://github.com/ToshY/pexels-scraper

๐Ÿ› ๏ธ Contribute

Prerequisites

Pre-commit

Set up pre-commit.

pre-commit install

Checks

task contribute

Note: you can use task black:fix to resolve codestyle issues.

โ• License

This repository comes with a MIT license.

pexels-scraper's People

Contributors

dependabot[bot] avatar toshy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pexels-scraper's Issues

Create docker image & refactor code

While I currently don't use this repo myself anymore, I feel the need to refactor the code and modernise it by also creating a docker image for it. If I keep the existing input arguments the same there won't be any breaking changes.

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.