semvec/pypi-packages huggingface dataset:
aio-pexels-test 1.0.0
An asynchronous wrapper for Pexels API based on aiohttp, which additionally allows to download photos in any of avaliable resolutions.
Requires Python: >=3.6


## An asynchronous wrapper for Pexels API based on aiohttp, which additionally allows to download photos in any of avaliable resolutions.


## Installation

Install aio_pexels with pip

```bash
  pip install aio_pexels
```
    
## Examples

Searching photos by query 
```python
from aio_pexels import AioPexels
from aio_pexels.types import PhotoSearchResponse

api = AioPexels(API_KEY)

async def get_photos_by_query(query: str) -> PhotoSearchResponse:
    response = await api.get_photos_by_query(query)
    print(response.total_results)  # 498

```
Getting photo by ID 
```python
from aio_pexels import AioPexels
from aio_pexels.types import PhotoSearchResponse

api = AioPexels(API_KEY)

async def get_photo_by_query(query: str) -> PhotoSearchResponse:
    response = await api.get_photos_by_query(query)
    print(response.total_results)  # 498

```
Downloading photo by ID 
```python
from aio_pexels import AioPexels

api = AioPexels(API_KEY)

async def get_photo_by_query(query: str) -> PhotoSearchResponse:
    response = await api.download_photo_by_id(photo_id=9999, destination = './photos/test.jpeg', quality='original'))

```


## рџ”— Links
[![](https://img.shields.io/github/stars/ggindinson?label=GitHub%20Repo&style=social)](https://github.com/ggindinson/aio_pexels)

[![Latest Version]](https://pypi.python.org/pypi/aio_pexels/)


## Feedback

I would be very pleased for a star в­ђпёЏ