Skip to main content

this is a simple client for youtube data api v3

Project description

This is a youtube data api v3 wrapper which can be integrated into any python app basically in the web app which recommends youtube videos.

https://img.shields.io/pypi/v/pyytdata https://travis-ci.org/Agent-Hellboy/YouTubeDataApi_Wrapper.svg?branch=master https://img.shields.io/pypi/pyversions/pyytdata.svg https://img.shields.io/pypi/l/pyytdata.svg https://pepy.tech/badge/pyytdata https://img.shields.io/pypi/format/pyytdata.svg https://coveralls.io/repos/github/Agent-Hellboy/YouTubeDataApi_Wrapper/badge.svg?branch=master

Prerequisites

Installation

for stable version
  • pip install pyytdata

for developement

using

 >>> from pyytdata import PyYtData
 >>> obj=PyYtData('flask',1)
 >>> vid=obj.get_videoinfo()
 >>> vid
 [<util.vidinfo.VidInfo object at 0x7ff971539e10>]


 #You can fire dir on this object to get the attribute and method of the object.
 >>> dir(vid[0])
 ['_Info__API_KEY', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_id', 'channel_info', 'get_description', 'get_image_url', 'get_link', 'get_publishedtime', 'get_title', 'keyword', 'maxlen', 'open_id', 'order', 'result', 'type', 'youtube']

 # To get the description of the video
 >>> vid[0].get_description()
 'Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. Learn how to use it ...'

 # To get the title of the video.
 >>> vid[0].get_title()
'Learn Flask for Python - Full Tutorial'

 # To get the link for the video which can we used in web app to open the link for the video.
 >>> vid[0].get_link()
'https://www.youtube.com/watch?v=Z1RJmh_OqeA'

 # To get the title img of the video which can be rendered through HTML tag.
 >>> vid[0].get_image_url()
'https://i.ytimg.com/vi/Z1RJmh_OqeA/mqdefault.jpg'

 # To get the date at which the video is published
 >>> vid[0].get_publisheddate()

 # To get the chnlInfo object having methods which describes a channel.
 >>> chnl=vid[0].channel_info()

 >>> dir(chnl)
 ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__',          '__ge__', '__getattribute__', '__gt__', '__hash__',  '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'id', 'result', 'total_subscriber', 'total_video', 'total_viewcnt', 'youtube']

 # To get the total view count of the channel.
 >>> chnl.total_viewcnt()
 '95246354'

 # To get the number of subscribers of the channel.
 >>> chnl.total_subscriber()
 '2170000'

 # To get number of video uploaded by this particular channel.
 >>> chnl.total_video()
 '1133'

 # To get the obejct having stat of the video
 >>> vidinf=vid[0]..video_stat()

 # To get total number of like to the video
 >>> vidinf.total_like()

 # To get total number of dislike to the video
 >>> vidinf.total_dislike()

 # To get total number of views
 >>> vidinf.total_view()

 # To get total number of comment on the video
 >>> vidinf.total_comment()

General Info

Under Developement

/images/info.png
  • I think the package has implemented the facade pattern as the lower level packages like videoinfo and chnlinfo are independent form pyytdata and is not exposed to client and also the interaction between querier and videoinfo is hidden from client by providing a interface/module pyytdata

  • vidoinfo class and Chnlinfo has composition relationship as video does not exixts without a channel

Package Architecture

Architecture

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyytdata-0.2.0.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file pyytdata-0.2.0.tar.gz.

File metadata

  • Download URL: pyytdata-0.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.9

File hashes

Hashes for pyytdata-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8dcd8b709e88f25ad815535037f6a0354c34f136c28e754adc5b37e0503b3fc4
MD5 d0fd1e844d5d3407334b0169b0c60f95
BLAKE2b-256 588de3924eea42f6b074dc0e243c620cdac2789f56095d59be4f450e796017ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page