Skip to content

Commit

Permalink
Rename project to YouTubeaio (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Jul 22, 2023
1 parent c23d29e commit 4a16253
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This package allows you to interact with the YouTube V3 API.
## Installation

```bash
pip install async-python-youtube
pip install youtubeaio
```

## Changelog & Releases
Expand Down Expand Up @@ -124,9 +124,9 @@ SOFTWARE.
[poetry]: https://python-poetry.org
[pre-commit]: https://pre-commit.com/
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
[python-versions-shield]: https://img.shields.io/pypi/pyversions/async-python-youtube
[python-versions-shield]: https://img.shields.io/pypi/pyversions/youtubeaio
[releases-shield]: https://img.shields.io/github/release/joostlek/python-youtube.svg
[releases]: https://github.com/joostlek/python-youtube/releases
[semver]: http://semver.org/spec/v2.0.0.html
[sonarcloud]: https://sonarcloud.io/summary/new_code?id=joostlek_python-youtube
[pypi]: https://pypi.org/project/async-python-youtube/
[pypi]: https://pypi.org/project/youtubeaio/
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "async_python_youtube"
name = "youtubeaio"
version = "0.0.0"
description = "Asynchronous Python client for YouTube V3 API."
authors = ["Joost Lekkerkerker <joostlek@outlook.com>"]
Expand All @@ -21,7 +21,7 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
]
packages = [
{ include = "async_python_youtube", from = "src" },
{ include = "youtubeaio", from = "src" },
]

[tool.poetry.dependencies]
Expand Down Expand Up @@ -57,7 +57,7 @@ show_missing = true

[tool.coverage.run]
plugins = ["covdefaults"]
source = ["async_python_youtube"]
source = ["youtubeaio"]

[tool.mypy]
# Specify the target platform details in config, so your developers are
Expand Down Expand Up @@ -146,7 +146,7 @@ ignore = [
"D417", # False positives in some occasions
"PLR2004", # Just annoying, not really useful
"TCH001",
"SLOT000",
"TRY301",
"FBT001", # Boolean positional arg
"FBT002", # Boolean default arg
"PLR0913", # A lot of arguments
Expand All @@ -158,7 +158,7 @@ fixture-parentheses = false
mark-parentheses = false

[tool.ruff.isort]
known-first-party = ["async_python_youtube"]
known-first-party = ["youtubeaio"]

[tool.ruff.mccabe]
max-complexity = 25
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from enum import Enum
from typing import Any, TypeVar

from async_python_youtube.types import AuthScope
from youtubeaio.types import AuthScope

__all__ = [
"YOUTUBE_AUTH_BASE_URL",
Expand All @@ -25,7 +25,7 @@
def build_scope(scopes: list[AuthScope]) -> str:
"""Build a valid scope string from list.
:param scopes: list of :class:`~async_python_youtube.types.AuthScope`
:param scopes: list of :class:`~youtubeaio.types.AuthScope`
:returns: the valid auth scope string
"""
return " ".join([s.value for s in scopes])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pydantic import BaseModel, Field

from async_python_youtube.const import LiveBroadcastContent
from youtubeaio.const import LiveBroadcastContent

__all__ = [
"YouTubeThumbnail",
Expand Down
8 changes: 4 additions & 4 deletions src/async_python_youtube/oauth.py → src/youtubeaio/oauth.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Oauth helpers for YouTube."""
import aiohttp

from async_python_youtube.helper import YOUTUBE_AUTH_TOKEN_URL, build_url
from async_python_youtube.types import InvalidRefreshTokenError, UnauthorizedError
from youtubeaio.helper import YOUTUBE_AUTH_TOKEN_URL, build_url
from youtubeaio.types import InvalidRefreshTokenError, UnauthorizedError

__all__ = ["refresh_access_token"]

Expand All @@ -21,9 +21,9 @@ async def refresh_access_token(
:param ~aiohttp.ClientSession session: optionally a active client session to be
used for the web request to avoid having to open a new one
:return: access_token, refresh_token
:raises ~async_python_youtube.types.InvalidRefreshTokenException: if refresh token
:raises ~youtubeaio.types.InvalidRefreshTokenException: if refresh token
is invalid
:raises ~async_python_youtube.types.UnauthorizedException: if both refresh and
:raises ~youtubeaio.types.UnauthorizedException: if both refresh and
access token are invalid (e.g. if the user changes their password of the app gets
disconnected)
:rtype: (str, str)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import async_timeout
from aiohttp import ClientResponse, ClientSession

from async_python_youtube.helper import (
from youtubeaio.helper import (
build_url,
first,
)
from async_python_youtube.models import YouTubeVideo
from async_python_youtube.types import (
from youtubeaio.models import YouTubeVideo
from youtubeaio.types import (
AuthScope,
MissingScopeError,
YouTubeAPIError,
Expand Down Expand Up @@ -144,9 +144,9 @@ async def set_user_authentication(
:attr:`auto_refresh_auth` is True |default| :code:`None`
:raises ValueError: if :attr:`auto_refresh_auth` is True but refresh_token is
not set
:raises ~async_python_youtube.types.MissingScopeException: if given token is
:raises ~youtubeaio.types.MissingScopeException: if given token is
missing one of the required scopes
:raises ~async_python_youtube.types.InvalidTokenException: if the given token
:raises ~youtubeaio.types.InvalidTokenException: if the given token
is invalid or for a different client id
"""
if refresh_token is None and self.auto_refresh_auth:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import aiohttp
import pytest

from async_python_youtube.types import AuthScope, MissingScopeError
from async_python_youtube.youtube import YouTube
from youtubeaio.types import AuthScope, MissingScopeError
from youtubeaio.youtube import YouTube


async def test_user_authentication() -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import pytest

from async_python_youtube.helper import build_scope, build_url, chunk, first, limit
from async_python_youtube.types import AuthScope
from youtubeaio.helper import build_scope, build_url, chunk, first, limit
from youtubeaio.types import AuthScope


async def _generator(amount: int) -> AsyncGenerator[int, None]:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from aiohttp.web_request import BaseRequest
from aresponses import Response, ResponsesMockServer

from async_python_youtube.oauth import refresh_access_token
from async_python_youtube.types import InvalidRefreshTokenError, UnauthorizedError
from youtubeaio.oauth import refresh_access_token
from youtubeaio.types import InvalidRefreshTokenError, UnauthorizedError

from . import load_fixture

Expand Down
4 changes: 2 additions & 2 deletions tests/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from aiohttp.web_request import BaseRequest
from aresponses import Response, ResponsesMockServer

from async_python_youtube.helper import first
from async_python_youtube.youtube import YouTube
from youtubeaio.helper import first
from youtubeaio.youtube import YouTube

from . import load_fixture

Expand Down
4 changes: 2 additions & 2 deletions tests/test_youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
from aiohttp.web_request import BaseRequest
from aresponses import Response, ResponsesMockServer

from async_python_youtube.types import (
from youtubeaio.types import (
YouTubeAPIError,
YouTubeBackendError,
YouTubeResourceNotFoundError,
)
from async_python_youtube.youtube import YouTube
from youtubeaio.youtube import YouTube

from . import load_fixture

Expand Down

0 comments on commit 4a16253

Please sign in to comment.