A simple way to get information on YouTube videos.
Project description
vidyo
A simple way to get information on YouTube videos.
Features
- Pythonic syntax lets you feel right at home
- Lightweight nature means you don't have to worry about excessive dependencies
- Simple to use objects take the hassle out of API inconsistencies
Installation
You need Python 3.7.0 or greater to run vidyo. You will also need to have a Google Developers project with the YouTube Data API enabled. You can find instructions on how to do that in the documentation.
It is recommended you install vidyo in a virtual environment. To do this, run the following:
# Windows
> py -3.9 -m venv .venv
> .venv\Scripts\activate
> pip install vidyo
# Linux\macOS
$ python3.9 -m venv .venv
$ source ./.venv/bin/activate
$ pip install vidyo
To install vidyo outside of a virtual environment instead, run the following:
# Windows
> py -3.9 -m pip install vidyo
# Linux/macOS
$ python3.9 -m pip install vidyo
You can also install the development version by running the following (this assumes you're on Linux/macOS):
$ git clone https://github.com/parafoxia/vidyo
$ cd vidyo
$ git checkout develop # Any valid branch name can go here.
$ python3.9 -m pip install -U .
Usage examples
The following example shows you how display the title and number of views of the first YouTube video and then download its thumbnail.
from vidyo import Client
# Load your API key from a file.
with open("secrets/api-key") as f:
key = f.read()
client = Client(key)
video = client.get_video("jNQXAC9IVRw")
print(f"{video.title} has {video.views:,} views.")
video.get_thumbnail().save("thumbnail.jpg")
License
The vidyo module for Python is licensed under the BSD-3-Clause License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.