Use Pexels API v1 with Python
Project description
PexelsPy
A Python package form API for pexels website. All the variables in the documentation are included.
INSTALLATION
pip install pexelsPY
Sample Program
This is a sample program to run in your terminal.
from pexelsPy import API
PEXELS_API = "YOUR-PEXELS-API"
api = API(PEXELS_API)
#For photos
api.search_photos('your search',page=no of pages, results_per_page=number)
photos = api.get_photos()
#for videos
api.search_videos('your search',page=no of pages, results_per_page=number)
videos = api.get_videos()
#To access the details in the variables photos and videos LOOP through the variable
#for photos
for data in photos:
print(data.[Your-required-data_structure])
#for videos
for data in videos:
print(data.[data_structure])
To use programs under singleSamples folder.
NOTE: First you must create a environment variable in your respective machine called 'PEXELS_API' with your API VALUE.
- Assuming you are in the same directory as the files are present.
searchPhotos.py
syntax: python searchPhotos.py your_required_search_name page_number Number_of_images_in_that_page
Example: python searchPhotos.py koala 1 1
popularPhotos.py
syntax: python popularPhotos.py page_number_you_want_to_search number_of_images_you_need
Example: python popularPhotos.py 2 2
curatedPhotos.py
syntax: python curatedPhotos.py page_number_you_want_to_search number_of_images_you_need
Example: python curatedPhotos.py 2 2
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pexelsPy-1.0.1rc0.tar.gz.
File metadata
- Download URL: pexelsPy-1.0.1rc0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60aa5a2e16334582c1bcf167cdea533f1eaf5ae63c579ff7ad8cc434678e8943
|
|
| MD5 |
e0940a16e5d99f7234efb54b50884bfe
|
|
| BLAKE2b-256 |
643e7a8af9c6b08830b74690841c3bc41873818005894563e0999335f4ee2a91
|
File details
Details for the file pexelsPy-1.0.1rc0-py3-none-any.whl.
File metadata
- Download URL: pexelsPy-1.0.1rc0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59a8cf0bd614548c8a47ae8ad7dbb1abad1cd80cf875db00585c8034263f71d0
|
|
| MD5 |
f24eb863a99e9324a3504db843166427
|
|
| BLAKE2b-256 |
d23c11604dfa62cb9de3012291ee57ea97d695bbae7621e02b193d1b2222fac9
|