Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
include:
- python-version: '3.12'
update-coverage: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
Expand Down Expand Up @@ -47,10 +48,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: '3.12'
- name: Cache pip
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion examples/apis/get_subscription_with_oauth.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This demo show how to use this library to do authorization and get your subscription.
This demo show how to use this library to do authorization and get your subscription.
"""

import pyyoutube
Expand Down
2 changes: 1 addition & 1 deletion examples/apis/oauth_flow.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This example demonstrates how to perform authorization.
This example demonstrates how to perform authorization.
"""

from pyyoutube import Api
Expand Down
2 changes: 1 addition & 1 deletion examples/clients/channel_info.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This example demonstrates how to retrieve information for a channel.
This example demonstrates how to retrieve information for a channel.
"""

from pyyoutube import Client
Expand Down
3 changes: 1 addition & 2 deletions examples/clients/oauth_flow.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""
This example demonstrates how to perform authorization.
This example demonstrates how to perform authorization.
"""

from pyyoutube import Client


CLIENT_ID = "xxx" # Your app id
CLIENT_SECRET = "xxx" # Your app secret
CLIENT_SECRET_PATH = None # or your path/to/client_secret_web.json
Expand Down
5 changes: 2 additions & 3 deletions examples/clients/oauth_refreshing.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
"""
This example demonstrates how to automatically (re)generate tokens for continuous OAuth.
We store the Access Token in a seperate .env file to be used later.
This example demonstrates how to automatically (re)generate tokens for continuous OAuth.
We store the Access Token in a seperate .env file to be used later.
"""

from pyyoutube import Client
from json import loads, dumps
from pathlib import Path


CLIENT_ID = "xxx" # Your app id
CLIENT_SECRET = "xxx" # Your app secret
CLIENT_SECRET_PATH = None # or your path/to/client_secret_web.json
Expand Down
2 changes: 1 addition & 1 deletion examples/clients/upload_video.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This example demonstrates how to upload a video.
This example demonstrates how to upload a video.
"""

import pyyoutube.models as mds
Expand Down
35 changes: 11 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
Expand All @@ -30,29 +29,17 @@ packages = [
]

[tool.poetry.dependencies]
python = "^3.6"
requests = "^2.24.0"
python = "^3.9"
requests = ">=2.28.0,<3.0.0"
requests-oauthlib = ">=1.3.0,<3.0.0"
isodate = ">=0.6.0,<=0.7.2"
dataclasses-json = [
{ version = "^0.5.3", python = "<3.7" },
{ version = "^0.6.0", python = ">=3.7" }
]
isodate = ">=0.6.1,<1.0.0"
dataclasses-json = ">=0.6.0,<1.0.0"

[tool.poetry.dev-dependencies]
responses = [
{ version = "^0.17.0", python = "<3.7" },
{ version = "^0.23.0", python = ">=3.7" }
]
pytest = [
{ version = "^6.2", python = "<3.7" },
{ version = "^7.1", python = ">=3.7" }
]
pytest-cov = [
{ version = "^2.10.1", python = "<3.7" },
{ version = "^3.0.0", python = ">=3.7" }
]
[tool.poetry.group.dev.dependencies]
responses = "^0.25.0"
pytest = "^8.4.0"
pytest-cov = "^6.2.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
requires = ["poetry-core>=2.0.0"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion pyyoutube/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Main Api implementation.
Main Api implementation.
"""

from typing import Optional, List, Union
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
New Client for YouTube API
New Client for YouTube API
"""

import inspect
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/media.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Media object to upload.
Media object to upload.
"""

import mimetypes
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/activity.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are activity related models.
These are activity related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/caption.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are caption related models
These are caption related models
"""

from dataclasses import dataclass, field
Expand Down
4 changes: 2 additions & 2 deletions pyyoutube/models/category.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
These are category related models.
Include VideoCategory
These are category related models.
Include VideoCategory
"""

from dataclasses import dataclass, field
Expand Down
4 changes: 2 additions & 2 deletions pyyoutube/models/channel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
These are channel related models.
These are channel related models.

References: https://developers.google.com/youtube/v3/docs/channels#properties
References: https://developers.google.com/youtube/v3/docs/channels#properties
"""

from dataclasses import dataclass, field
Expand Down
4 changes: 2 additions & 2 deletions pyyoutube/models/channel_banner.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
There are channel banner related models
There are channel banner related models

References: https://developers.google.com/youtube/v3/docs/channelBanners#properties
References: https://developers.google.com/youtube/v3/docs/channelBanners#properties
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/channel_section.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Those are models related to channel sections.
Those are models related to channel sections.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/comment.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are comment related models.
These are comment related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/comment_thread.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are comment threads related models.
These are comment threads related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are common models for multi resource.
These are common models for multi resource.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/i18n.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are i18n language and region related models.
These are i18n language and region related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/member.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are member related models.
These are member related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/memberships_level.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are membership level related models.
These are membership level related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/mixins.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are some mixin for models
These are some mixin for models
"""

import datetime
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/playlist.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are playlist related models.
These are playlist related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/playlist_item.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are playlistItem related models.
These are playlistItem related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/search_result.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are search result related models.
These are search result related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/subscription.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are subscription related models.
These are subscription related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/video.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are video related models.
These are video related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/video_abuse_report_reason.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are video abuse report reason related models.
These are video abuse report reason related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/models/watermark.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
These are watermark related models.
These are watermark related models.
"""

from dataclasses import dataclass, field
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/activities.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Activities resource implementation
Activities resource implementation
"""

from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/base_resource.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Base resource class.
Base resource class.
"""

from typing import Optional, TYPE_CHECKING
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/captions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Captions resource implementation
Captions resource implementation
"""

from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/channel_banners.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Channel banners resource implementation.
Channel banners resource implementation.
"""

from typing import Optional
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/channel_sections.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Channel Section resource implementation.
Channel Section resource implementation.
"""

from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/channels.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Channel resource implementation.
Channel resource implementation.
"""

from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/comment_threads.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Comment threads resource implementation.
Comment threads resource implementation.
"""

from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/comments.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Comment resource implementation.
Comment resource implementation.
"""

from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/i18n_languages.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
i18n language resource implementation.
i18n language resource implementation.
"""

from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/i18n_regions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
i18n regions resource implementation.
i18n regions resource implementation.
"""

from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/members.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Members resource implementation.
Members resource implementation.
"""

from typing import Optional, Union
Expand Down
2 changes: 1 addition & 1 deletion pyyoutube/resources/membership_levels.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Membership levels resource implementation.
Membership levels resource implementation.
"""

from typing import Optional, Union
Expand Down
Loading
Loading