Skip to main content

A wrapper that allows easy interaction with the Pexels API for everyone

Project description

GetFromPexels

GetFromPexels is an elegant Pexels API wrapper that is available for everyone to use with the Python programming language.

Examples

Finding images

# Finding 3 images of cats
from getfrompexels import PexelsSession
session = PexelsSession(API_KEY)
query = session.search_for_photos("cat", per_page=3)

for photo in query.contents:
    print(photo.pexels_url)

Finding videos

# Searching for dogs barking
from getfrompexels import PexelsSession
session = PexelsSession(API_KEY)

# Turning to page 2
query = session.search_for_videos("dog barking", page=2, per_page=3)

for video in query.contents:
    print(video.pexels_url)

Saving to files

# Downloading the first image that pops up when you search "bird"
from getfrompexels import PexelsSession
session = PexelsSession(API_KEY)

# Searching for the first result for "bird"
results = session.search_for_photos("bird", per_page=1).contents
photo = results[0]

# Downloading the photo
photo.download(PATH, "large2x")  # Several sizes accepted

Documentation

All classes and functions contain docstrings using the reST format as code documentation.

Additional Information

The library requires for the requests module to be installed.
If it isn't, running pip install requests in the terminal should install the library.

The earliest Python version that can use this library is Python 3.11.

To request an API key, you must make a Pexels account and get one from the official Pexels website.
The official documentation for the Pexels APi is https://www.pexels.com/api/documentation/, which contains information about endpoints and their results. GetFromPexels' main purpose is to provide anyone access to all the endpoints and provide an easy wrapper.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

getfrompexels-1.1.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

getfrompexels-1.1.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file getfrompexels-1.1.0.tar.gz.

File metadata

  • Download URL: getfrompexels-1.1.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for getfrompexels-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f3e502826580bc8874b3472abfb14db9cd710c9c097179346a19c7a87d27d1c1
MD5 f9053e1c7bea6e39cf30fdb428eb7884
BLAKE2b-256 ccbf9def569e4485293e6a912e7b50d7d81ffc79a414cce23dec4db943431481

See more details on using hashes here.

File details

Details for the file getfrompexels-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: getfrompexels-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for getfrompexels-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc54601cf1e0042064940bf52e95501a143fc64ba1e067b141e05746b7bb16db
MD5 04b41d48cf0ed806e17a937b0600aad9
BLAKE2b-256 59b21ccf37d8391793de9b6889a301bf49d9986388c58bc7e90aaf2f7bc1be02

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page