ayt-api


Nameayt-api JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/Revnoplex/ayt-api
SummaryA basic, asynchronous, object-oriented YouTube API wrapper written in Python.
upload_time2025-01-06 06:12:50
maintainerNone
docs_urlNone
authorRevnoplex
requires_python>=3.9.0
license# MIT License Copyright (c) 2022-2025 Revnoplex Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords api youtube async asyncio aiohttp object-oriented object oriented youtube api youtube-api wrapper youtube api wrapper youtube-api-wrapper api wrapper api-wrapper wrapper-api wrapper api wrapper library wrapper-library
VCS
bugtrack_url
requirements aiohttp wheel isodate setuptools
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI](https://img.shields.io/pypi/v/ayt-api?style=for-the-badge&logo=pypi)](https://pypi.org/project/ayt-api/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ayt-api?style=for-the-badge&logo=python)
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/Revnoplex/ayt-api?style=for-the-badge&logo=github)](https://github.com/revnoplex/ayt-api)
![PyPI - Downloads per month](https://img.shields.io/pypi/dm/ayt-api?style=for-the-badge&logo=pypi)
![Supported Python Versions](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FRevnoplex%2Fayt-api%2Frefs%2Fheads%2Fmain%2Fpyproject.toml&style=for-the-badge&logo=python)
![Repo Created At](https://img.shields.io/github/created-at/Revnoplex/ayt-api?style=for-the-badge)
# [![AYT API](https://ayt-api.revnoplex.xyz/ayt-api.svg)](https://ayt-api.revnoplex.xyz)

A Basic, Asynchronous, Object-Oriented YouTube API Wrapper Written in Python.

The library is designed towards being used in python based discord bots that use an asynchronous discord api wrapper

## Installation

### Stable Release:
The latest stable version is available on pypi
#### Windows:
```powershell
python -m pip install -U ayt-api
```

#### Unix based OSes (Linux, Mac OS, etc.):
The pip command can vary between different unix based OSes but should be simular to these:
```sh
python3 -m pip install -U ayt-api

# or

pip3 install -U ayt-api
```

### Latest Commit:
Installing the latest commit from here. You will need git or something simular installed to download the library
#### Windows:
```powershell
python -m pip install -U "git+https://github.com/Revnoplex/ayt-api.git"
```

#### Unix based OSes (Linux, Mac OS, etc.):
The pip command can vary between diffrent unix based OSes but should be simular to these:
```sh
python3 -m pip install -U git+https://github.com/Revnoplex/ayt-api.git

# or

pip3 install -U git+https://github.com/Revnoplex/ayt-api.git
```

## Usage

First of all to use this library, you will need an API key. To get one, [see here for instructions](https://ayt-api-docs.revnoplex.xyz/en/latest/usage/obtaining-credentials.html)

### Basic video data fetching:
```python
import asyncio
import ayt_api

api = ayt_api.AsyncYoutubeAPI("Your API Key")


async def video_example():
    video_data = await api.fetch_video("Video ID")
    print(video_data.id)
    print(video_data.channel_id)
    print(video_data.url)
    print(video_data.title)
    print(video_data.thumbnails.default.url)
    print(video_data.visibility)
    print(video_data.duration)
    print(video_data.view_count)
    print(video_data.like_count)
    print(video_data.embed_html)
    print(video_data.published_at)
    print(video_data.description)
    print(video_data.age_restricted)

loop = asyncio.new_event_loop()
loop.run_until_complete(video_example())
```

### Basic playlist data fetching:
```python
import asyncio
import ayt_api

api = ayt_api.AsyncYoutubeAPI("Your API Key")


async def playlist_example():
    playlist_data = await api.fetch_playlist("Playlist ID")
    print(playlist_data.id)
    print(playlist_data.channel_id)
    print(playlist_data.url)
    print(playlist_data.title)
    print(playlist_data.thumbnails.default.url)
    print(playlist_data.visibility)
    print(playlist_data.published_at)
    print(playlist_data.description)
    print(playlist_data.embed_html)
    print(playlist_data.item_count)

loop = asyncio.new_event_loop()
loop.run_until_complete(playlist_example())
```

### Basic playlist video fetching:
```python
import asyncio
import ayt_api

api = ayt_api.AsyncYoutubeAPI("Your API Key")


async def playlist_video_example():
    playlist_videos = await api.fetch_playlist_videos("Playlist ID")
    video = playlist_videos[0]
    print(video.id)
    print(video.channel_id)
    print(video.url)
    print(video.title)
    print(video.thumbnails.default.url)
    print(video.visibility)
    print(video.published_at)
    print(video.description)
    print(video.duration)

loop = asyncio.new_event_loop()
loop.run_until_complete(playlist_video_example())
```

More examples are listed [here](https://github.com/Revnoplex/ayt-api/tree/main/examples)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Revnoplex/ayt-api",
    "name": "ayt-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9.0",
    "maintainer_email": null,
    "keywords": "api, youtube, async, asyncio, aiohttp, object-oriented, object oriented, youtube api, youtube-api, wrapper, youtube api wrapper, youtube-api-wrapper, api wrapper, api-wrapper, wrapper-api, wrapper api, wrapper library, wrapper-library",
    "author": "Revnoplex",
    "author_email": "Revnoplex <revnoplex.business@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/39/aa/361ab68a61ec56a1ec770abd311df94453dd7149b147ec34974197d78974/ayt_api-0.4.0.tar.gz",
    "platform": null,
    "description": "[![PyPI](https://img.shields.io/pypi/v/ayt-api?style=for-the-badge&logo=pypi)](https://pypi.org/project/ayt-api/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ayt-api?style=for-the-badge&logo=python)\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/Revnoplex/ayt-api?style=for-the-badge&logo=github)](https://github.com/revnoplex/ayt-api)\n![PyPI - Downloads per month](https://img.shields.io/pypi/dm/ayt-api?style=for-the-badge&logo=pypi)\n![Supported Python Versions](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2FRevnoplex%2Fayt-api%2Frefs%2Fheads%2Fmain%2Fpyproject.toml&style=for-the-badge&logo=python)\n![Repo Created At](https://img.shields.io/github/created-at/Revnoplex/ayt-api?style=for-the-badge)\n# [![AYT API](https://ayt-api.revnoplex.xyz/ayt-api.svg)](https://ayt-api.revnoplex.xyz)\n\nA Basic, Asynchronous, Object-Oriented YouTube API Wrapper Written in Python.\n\nThe library is designed towards being used in python based discord bots that use an asynchronous discord api wrapper\n\n## Installation\n\n### Stable Release:\nThe latest stable version is available on pypi\n#### Windows:\n```powershell\npython -m pip install -U ayt-api\n```\n\n#### Unix based OSes (Linux, Mac OS, etc.):\nThe pip command can vary between different unix based OSes but should be simular to these:\n```sh\npython3 -m pip install -U ayt-api\n\n# or\n\npip3 install -U ayt-api\n```\n\n### Latest Commit:\nInstalling the latest commit from here. You will need git or something simular installed to download the library\n#### Windows:\n```powershell\npython -m pip install -U \"git+https://github.com/Revnoplex/ayt-api.git\"\n```\n\n#### Unix based OSes (Linux, Mac OS, etc.):\nThe pip command can vary between diffrent unix based OSes but should be simular to these:\n```sh\npython3 -m pip install -U git+https://github.com/Revnoplex/ayt-api.git\n\n# or\n\npip3 install -U git+https://github.com/Revnoplex/ayt-api.git\n```\n\n## Usage\n\nFirst of all to use this library, you will need an API key. To get one, [see here for instructions](https://ayt-api-docs.revnoplex.xyz/en/latest/usage/obtaining-credentials.html)\n\n### Basic video data fetching:\n```python\nimport asyncio\nimport ayt_api\n\napi = ayt_api.AsyncYoutubeAPI(\"Your API Key\")\n\n\nasync def video_example():\n    video_data = await api.fetch_video(\"Video ID\")\n    print(video_data.id)\n    print(video_data.channel_id)\n    print(video_data.url)\n    print(video_data.title)\n    print(video_data.thumbnails.default.url)\n    print(video_data.visibility)\n    print(video_data.duration)\n    print(video_data.view_count)\n    print(video_data.like_count)\n    print(video_data.embed_html)\n    print(video_data.published_at)\n    print(video_data.description)\n    print(video_data.age_restricted)\n\nloop = asyncio.new_event_loop()\nloop.run_until_complete(video_example())\n```\n\n### Basic playlist data fetching:\n```python\nimport asyncio\nimport ayt_api\n\napi = ayt_api.AsyncYoutubeAPI(\"Your API Key\")\n\n\nasync def playlist_example():\n    playlist_data = await api.fetch_playlist(\"Playlist ID\")\n    print(playlist_data.id)\n    print(playlist_data.channel_id)\n    print(playlist_data.url)\n    print(playlist_data.title)\n    print(playlist_data.thumbnails.default.url)\n    print(playlist_data.visibility)\n    print(playlist_data.published_at)\n    print(playlist_data.description)\n    print(playlist_data.embed_html)\n    print(playlist_data.item_count)\n\nloop = asyncio.new_event_loop()\nloop.run_until_complete(playlist_example())\n```\n\n### Basic playlist video fetching:\n```python\nimport asyncio\nimport ayt_api\n\napi = ayt_api.AsyncYoutubeAPI(\"Your API Key\")\n\n\nasync def playlist_video_example():\n    playlist_videos = await api.fetch_playlist_videos(\"Playlist ID\")\n    video = playlist_videos[0]\n    print(video.id)\n    print(video.channel_id)\n    print(video.url)\n    print(video.title)\n    print(video.thumbnails.default.url)\n    print(video.visibility)\n    print(video.published_at)\n    print(video.description)\n    print(video.duration)\n\nloop = asyncio.new_event_loop()\nloop.run_until_complete(playlist_video_example())\n```\n\nMore examples are listed [here](https://github.com/Revnoplex/ayt-api/tree/main/examples)\n",
    "bugtrack_url": null,
    "license": "# MIT License  Copyright (c) 2022-2025 Revnoplex  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A basic, asynchronous, object-oriented YouTube API wrapper written in Python.",
    "version": "0.4.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/Revnoplex/ayt-api/issues",
        "Changelog": "https://github.com/Revnoplex/ayt-api/blob/main/CHANGELOG.md",
        "Documentation": "https://ayt-api-docs.revnoplex.xyz",
        "Homepage": "https://ayt-api.revnoplex.xyz",
        "Repository": "https://github.com/Revnoplex/ayt-api"
    },
    "split_keywords": [
        "api",
        " youtube",
        " async",
        " asyncio",
        " aiohttp",
        " object-oriented",
        " object oriented",
        " youtube api",
        " youtube-api",
        " wrapper",
        " youtube api wrapper",
        " youtube-api-wrapper",
        " api wrapper",
        " api-wrapper",
        " wrapper-api",
        " wrapper api",
        " wrapper library",
        " wrapper-library"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "431f984f4b07cd042092ab92871d995b4e1a911905f3ff9e14f9c04ce9dc1335",
                "md5": "6be7b30f3abad3bbc024d678001dbf7e",
                "sha256": "d11a00783ee746dabcc540cee96ae1e1cda1acadc05aff0d60c3788e0f2082d5"
            },
            "downloads": -1,
            "filename": "ayt_api-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6be7b30f3abad3bbc024d678001dbf7e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9.0",
            "size": 59551,
            "upload_time": "2025-01-06T06:12:47",
            "upload_time_iso_8601": "2025-01-06T06:12:47.922423Z",
            "url": "https://files.pythonhosted.org/packages/43/1f/984f4b07cd042092ab92871d995b4e1a911905f3ff9e14f9c04ce9dc1335/ayt_api-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "39aa361ab68a61ec56a1ec770abd311df94453dd7149b147ec34974197d78974",
                "md5": "3349734cb44270d61dfa56b3d4936057",
                "sha256": "5353b24a1af983c48f34a43d2b114ab770ccd07ce2da1ab0019a91bbcdbb207b"
            },
            "downloads": -1,
            "filename": "ayt_api-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3349734cb44270d61dfa56b3d4936057",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9.0",
            "size": 60493,
            "upload_time": "2025-01-06T06:12:50",
            "upload_time_iso_8601": "2025-01-06T06:12:50.747294Z",
            "url": "https://files.pythonhosted.org/packages/39/aa/361ab68a61ec56a1ec770abd311df94453dd7149b147ec34974197d78974/ayt_api-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-06 06:12:50",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Revnoplex",
    "github_project": "ayt-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "aiohttp",
            "specs": [
                [
                    ">=",
                    "3.8.1"
                ]
            ]
        },
        {
            "name": "wheel",
            "specs": [
                [
                    ">=",
                    "0.37.1"
                ]
            ]
        },
        {
            "name": "isodate",
            "specs": [
                [
                    ">=",
                    "0.6.1"
                ]
            ]
        },
        {
            "name": "setuptools",
            "specs": [
                [
                    ">=",
                    "62.3.2"
                ]
            ]
        }
    ],
    "lcname": "ayt-api"
}
        
Elapsed time: 0.58050s