aiopypexels


Nameaiopypexels JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryAn asynchronous wrapper for Pexels API based on aiohttp, which additionally allows to download photos in any of avaliable resolutions.
upload_time2023-04-02 15:55:53
maintainer
docs_urlNone
authorggindinson
requires_python>=3.6
license
keywords pexels api photos
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
## An asynchronous wrapper for Pexels API based on aiohttp, which additionally allows to download photos in any of avaliable resolutions.


## Installation

Install aiopypexels with pip

```bash
  pip install aiopypexels
```
    
## Examples

Searching photos by query 
```python
from aiopypexels import AioPexels
from aiopypexels.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 aiopypexels import AioPexels
from aiopypexels.types import Photo

api = AioPexels(API_KEY)

async def get_photo_by_id(id: int) -> Photo:
    photo = await api.get_photo_by_id(id)

```
Downloading photo by ID 
```python
from aiopypexels import AioPexels

api = AioPexels(API_KEY)

async def download_photo_by_id(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/aiopypexels)

[Latest Version](https://pypi.python.org/pypi/aiopypexels/)


## Feedback

I would be very pleased for a star :-)


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "aiopypexels",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "pexels,api,photos",
    "author": "ggindinson",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/b3/6f/31dd9c55d6867bd49408ad4379e92ca587d4ad3dbffbab5a5d17f08c8c44/aiopypexels-1.0.1.tar.gz",
    "platform": null,
    "description": "\r\n## An asynchronous wrapper for Pexels API based on aiohttp, which additionally allows to download photos in any of avaliable resolutions.\r\n\r\n\r\n## Installation\r\n\r\nInstall aiopypexels with pip\r\n\r\n```bash\r\n  pip install aiopypexels\r\n```\r\n    \r\n## Examples\r\n\r\nSearching photos by query \r\n```python\r\nfrom aiopypexels import AioPexels\r\nfrom aiopypexels.types import PhotoSearchResponse\r\n\r\napi = AioPexels(API_KEY)\r\n\r\nasync def get_photos_by_query(query: str) -> PhotoSearchResponse:\r\n    response = await api.get_photos_by_query(query)\r\n    print(response.total_results)  # 498\r\n\r\n```\r\nGetting photo by ID \r\n```python\r\nfrom aiopypexels import AioPexels\r\nfrom aiopypexels.types import Photo\r\n\r\napi = AioPexels(API_KEY)\r\n\r\nasync def get_photo_by_id(id: int) -> Photo:\r\n    photo = await api.get_photo_by_id(id)\r\n\r\n```\r\nDownloading photo by ID \r\n```python\r\nfrom aiopypexels import AioPexels\r\n\r\napi = AioPexels(API_KEY)\r\n\r\nasync def download_photo_by_id(query: str) -> PhotoSearchResponse:\r\n    response = await api.download_photo_by_id(photo_id=9999, destination = './photos/test.jpeg', quality='original')\r\n\r\n```\r\n\r\n\r\n## Links\r\n[![](https://img.shields.io/github/stars/ggindinson?label=GitHub%20Repo&style=social)](https://github.com/ggindinson/aiopypexels)\r\n\r\n[Latest Version](https://pypi.python.org/pypi/aiopypexels/)\r\n\r\n\r\n## Feedback\r\n\r\nI would be very pleased for a star :-)\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "An asynchronous wrapper for Pexels API based on aiohttp, which additionally allows to download photos in any of avaliable resolutions.",
    "version": "1.0.1",
    "split_keywords": [
        "pexels",
        "api",
        "photos"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "538c3e4aed5326905d78d98208c10693ab8abcd69896638134d78ce24abd18fb",
                "md5": "545011e59c3842a712009f756a5c5a6d",
                "sha256": "4e064c2737b055a064f383d87826fed1dd27f75b44abd5fa7e895cdaf1be819a"
            },
            "downloads": -1,
            "filename": "aiopypexels-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "545011e59c3842a712009f756a5c5a6d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 8157,
            "upload_time": "2023-04-02T15:55:50",
            "upload_time_iso_8601": "2023-04-02T15:55:50.884897Z",
            "url": "https://files.pythonhosted.org/packages/53/8c/3e4aed5326905d78d98208c10693ab8abcd69896638134d78ce24abd18fb/aiopypexels-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b36f31dd9c55d6867bd49408ad4379e92ca587d4ad3dbffbab5a5d17f08c8c44",
                "md5": "4542dc10b6d7cb52183516b9f76adf51",
                "sha256": "ce8909beb1852f20075a4e97a19b30f20f0d43a26670ad6965291691fb7d2343"
            },
            "downloads": -1,
            "filename": "aiopypexels-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4542dc10b6d7cb52183516b9f76adf51",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 6610,
            "upload_time": "2023-04-02T15:55:53",
            "upload_time_iso_8601": "2023-04-02T15:55:53.459466Z",
            "url": "https://files.pythonhosted.org/packages/b3/6f/31dd9c55d6867bd49408ad4379e92ca587d4ad3dbffbab5a5d17f08c8c44/aiopypexels-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-02 15:55:53",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "aiopypexels"
}
        
Elapsed time: 0.06930s