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)
Metadata
Release files for ytanalysis 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ytanalysis-0.1.0.tar.gz | 3.6 kB | Without provenance | Details for ytanalysis-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ytanalysis-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ytanalysis-0.1.0-py3-none-any.whl |
Total release size: 7.7 kB
Release files / ytanalysis-0.1.0.tar.gz
| Download URL | ytanalysis-0.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
df119c32f0f861be0eaf018dbbecda0bdf4e6355c08b4dd9fa4d3b1179d5bd6c
|
|
BLAKE2b-256 checksum How to use checksums |
ef11e906b2cee5f667e0bbc5ad6152cbe0f54224e281bd508c485e336b4a01ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.4
|
Release files / ytanalysis-0.1.0-py3-none-any.whl
| Download URL | ytanalysis-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3e38f97ec7a829e2aa89e1c682fc6de65e028bd3bad796c6afa6492f6bd0d457
|
|
BLAKE2b-256 checksum How to use checksums |
aa238dc33e2b1dd6235dbad831c47736f0b6f50e98d491157882de284ce3d206
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.4
|
Security for ytanalysis 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.