YoutubeSDK
Python SDK for accessing Youtube APIs.
Requirements
- Python 3
- Requests library
$ pip install requests
Installation
Install from pip
$ pip install youtube-sdk-py
Usage
You can just initialize with an api key:
import youtubesdk
youtube = youtubesdk.Connection(api_key='your api key')
Access various methods in this format
# Channel
channel = youtube.get_channel(channel_id='UCp03YiAWc48Ay9Ew4Nu6_UA')
# Video
video = youtube.get_video(video_id='rbfOxR3OiW8')
# Comment Threads
comment_threads = youtube.get_comment_threads(video_id='EkDuCWOHBVU')
# Comments
comments = youtube.get_comments(comment_id='UgwNpeGtLn59UjTrW7N4AaABAg')
# Playlist Items
playlist_items = youtube.get_playlist_items(playlist_id='PL9a4goxNJut0xjwPV4CZlIJUGuOzwrih0')
# Playlists
playlists = youtube.get_playlists(channel_id='UCp03YiAWc48Ay9Ew4Nu6_UA')
# Search
search = youtube.get_search(channel_id='UCp03YiAWc48Ay9Ew4Nu6_UA', query='full stack')
# Quota
api_units = youtube.api_units_calculator(channel_id='UCp03YiAWc48Ay9Ew4Nu6_UA')
# Channel Statistics - This would return data in the below schema
channel_stats = youtube.get_channel_stats(channel_id='UCp03YiAWc48Ay9Ew4Nu6_UA')
{
'apiUnitsConsumed': api_units,
'channelInfo': channel_info,
'detailedVideoStats': {
'most': {
'views': most_viewed_video,
'likes': most_liked_video,
'dislikes': most_disliked_video,
'comments': most_comments_video
},
'least': {
'views': least_viewed_video,
'likes': least_liked_video,
'dislikes': least_disliked_video,
'comments': least_comments_video
}
}
}
License
This project is licensed under the MIT License - see the LICENSE file for details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
youtube-sdk-py-0.1.0.tar.gz
(5.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file youtube-sdk-py-0.1.0.tar.gz.
File metadata
- Download URL: youtube-sdk-py-0.1.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
825e7b43a4f222d3be16dcf38a8497027823181aa34585e6ee463956483a9b95
|
|
| MD5 |
814bc438b302ac75afc651279a049b8d
|
|
| BLAKE2b-256 |
d0b969829dedaf8f2fae630f9985f695be6c92baad3da7b28dd172c6c8d661a9
|
File details
Details for the file youtube_sdk_py-0.1.0-py3-none-any.whl.
File metadata
- Download URL: youtube_sdk_py-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
347cd7abfcb22b12dfd88c684bf6bcab85a0aca63faa177f343c4033446641c5
|
|
| MD5 |
2b527ce7c44f30c561cbcb7b70b1d6d4
|
|
| BLAKE2b-256 |
ac3994324128e8284d1ea2a9c5898d4914c1db6f0c22a521466e3c005e1d1944
|