Skip to main content

a Python library for interacting with Pixabay api

Project description

Pixabay_Python

This is a Python library for interacting with Pixabay api.

Requirements

Requirements can be installed by this line:

$ python -m pip install pixabay_python

Usage

You need to first sign up to Pixabay and get an api key from here. Then you can use your api key to access Pixabay like the following examples

example 1

import pixabay_python as pxb

client = pxb.PixabayClient(apiKey="your_api_key") 
searchResult = client.searchImage(q="tree")
hitsList = list(searchResult.hits)
pxb.download(url=hitsList[0].largeImageURL, outputDir="./anOutDir")

example 2

import pixabay_python as pxb

client = pxb.PixabayClient(apiKey="your_api_key") 
searchResult = client.searchImage(q="tree")
hitsList = list(searchResult.hits)
someSelectedURLs = [hit.largeImageURL for hit in hitsList[:5]]
pxb.downloadList(urlList=someSelectedURLs, outputDir="./anOutDir")

License

Pixabay_Python is licensed under Apache 2.0 License.

Credits

  • Developed by Farzad Shayanfar

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

pixabay_python-1.1.0.tar.gz (16.2 kB view hashes)

Uploaded Source

Built Distribution

pixabay_python-1.1.0-py3-none-any.whl (15.5 kB view hashes)

Uploaded Python 3

Supported by

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