Skip to main content

Asynchronous API wrapper for Pexels

Project description

Asynchronous API wrapper for Pexels

Python-3.7

A simple and easy to use Pexels API wrapper.

Example

You can initialize a session in 2 ways

Without context manager

import asyncio
from aiopexels import PexelsSession

async def main():
    pexels = PexelsSession('YOUR API KEY')
    result = await pexels.find_photos('plane')
    async for photo in result.get_all_photos():
        # Do something with the photo...

    await pexels.close()


asyncio.run(main())

With context manager

import asyncio
from aiopexels import PexelsSession

async def main():
    async with PexelsSession('YOUR API KEY') as pexels:
        video = await pexels.get_video(12345)
        print(video.url)
        # Do something else...


asyncio.run(main())

License

Copyright 2019 CyCanCode

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note

This wrapper is still under development. Docs will be pushed soon.

Project details


Release history Release notifications

This version

0.1.0

Download files

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

Files for aiopexels, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size aiopexels-0.1.0-py3-none-any.whl (16.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size aiopexels-0.1.0.tar.gz (7.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page