A package for analyzing YouTube channel statistics using the YouTube API
Project description
ytanalysis
ytanalysis is a Python package designed to analyze YouTube channel statistics using the YouTube Data API. With this package, you can retrieve information about a YouTube channel, including subscriber count, video details, views, likes, comments, and more. It also provides visualization tools to help analyze video views and monthly posting frequency.
Features
- Retrieve detailed YouTube channel statistics (subscribers, views, total videos, etc.)
- Extract video statistics such as views, likes, and comments
- Export video data to a CSV file for further analysis
- Generate visualizations for top-performing videos and monthly posting frequency
Installation
To install this package, use pip:
pip install ytanalysis
## Prerequisites
You need a YouTube Data API key to use this package. Follow these steps to obtain one:
1. Go to the [Google Cloud Console](https://console.cloud.google.com/).
2. Create a new project (or select an existing one) and navigate to **APIs & Services** > **Library**.
3. Search for "YouTube Data API v3" and enable it for your project.
4. Go to **APIs & Services** > **Credentials** and create an API key.
5. Copy the API key for later use.
## Usage
### Initialization
To initialize the `YTAnalysis` class, replace `YOUR_YOUTUBE_API_KEY` with your actual API key and `CHANNEL_URL` with the YouTube channel URL you want to analyze:
```python
from ytanalysis import YTAnalysis
api_key = "YOUR_YOUTUBE_API_KEY"
channel_url = "https://www.youtube.com/channel/CHANNEL_ID"
yt = YTAnalysis(channelURL=channel_url, apikey=api_key)
### Methods
#### Get Channel Details
```python
channel_info = yt.getChannelDetail()
print(channel_info)
#### Get Video Details
```python
video_details = yt.getVideoDetail()
print(video_details)
#### Export Details
```python
yt.export_csv()
#### Plot Views
```python
yt.plotViews(values=10, mostViewed=True, save=False)
#### Plot View Count
```python
yt.plotVideoCount(save=False)
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.
Source Distribution
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 ytanalysis-0.1.0.tar.gz.
File metadata
- Download URL: ytanalysis-0.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df119c32f0f861be0eaf018dbbecda0bdf4e6355c08b4dd9fa4d3b1179d5bd6c
|
|
| MD5 |
e0c2a1d68b54bc9bf3115ef364c683bd
|
|
| BLAKE2b-256 |
ef11e906b2cee5f667e0bbc5ad6152cbe0f54224e281bd508c485e336b4a01ee
|
File details
Details for the file ytanalysis-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ytanalysis-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e38f97ec7a829e2aa89e1c682fc6de65e028bd3bad796c6afa6492f6bd0d457
|
|
| MD5 |
f903aeeb11171081d2bd13fc0956b70a
|
|
| BLAKE2b-256 |
aa238dc33e2b1dd6235dbad831c47736f0b6f50e98d491157882de284ce3d206
|