Code Monkey home page Code Monkey logo

pypexels's Introduction

PyPexels

Latest Version Documentation Status Build Status Code Coverage Code Climate Code Health Say Thanks

An open source Python wrapper for the Pexels REST API. The source code is available on GitHub at https://github.com/salvoventura/pypexels.

Note

When using this library you still need to abide to Pexels Guidelines, which are explained on Pexels API page

Installation

PyPexels is available on PyPI and thus can be installed with pip on most platforms.

$ pip install pypexels

Dependencies

This library depends on Requests to make - well - requests to the Pexels API. This additional package should be automatically installed at installation time, or you can simply install it by:

$ pip install requests

Examples

This example shows how the interaction with the paging functionality of the Pexels API is greatly abstracted and simplified. The code below will iterate through all popular images, and print attributes for each photo in there.

from pypexels import PyPexels
api_key = 'YOUR_API_KEY'

# instantiate PyPexels object
py_pexels = PyPexels(api_key=api_key)

popular_photos = py_pexels.popular(per_page=30)
while popular_photos.has_next:
    for photo in popular_photos.entries:
        print(photo.id, photo.photographer, photo.url)
    # no need to specify per_page: will take from original object
    popular_photos = popular_photos.get_next_page()

Documentation

Documentation is published on ReadTheDocs.

Version

PyPexels v1.0.0b1 (beta, v1)

First release with wrappers around the two Pexels API for search and popular.

Note that using this library you still need to abide to Pexels Guidelines, which are explained on Pexels API page

License

PyPexels is released under the MIT License.

pypexels's People

Contributors

salvoventura avatar

Watchers

Bekhtin Sergey 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.