Twitch module for Python
Project description
# Twitch Python
[![Discord](https://user-images.githubusercontent.com/7288322/34471967-1df7808a-efbb-11e7-9088-ed0b04151291.png)](https://discord.gg/wZJFeXC)
`Work in progress`
Twitch Python provides API data to [PetterKraabol/Twitch-Chat-Downloader](https://github.com/PetterKraabol/Twitch-Chat-Downloader).
### Requirements
* [Python 3.6 or newer](https://www.python.org/downloads/)
* [A Twitch client ID](https://dev.twitch.tv/dashboard/apps)
### Usage
```python
import twitch
# Twitch Helix API
helix = twitch.Helix('client-id')
# Multiple users by name and id
for user in helix.users('sodapoppin', 'reckful', 24250859):
print(user.display_name)
# Single user
print(helix.user('zarlach').display_name)
# Videos
for video in helix.videos([318017128, 317650435]):
print(video.title)
# Single video
print(helix.video(318017128).title)
# Video comments
for comment in helix.video(318017128).comments():
print(comment.commenter.display_name)
# Comments from multiple videos
for video, comments in helix.videos([318017128, 317650435]).comments():
for comment in comments:
print(comment.commenter.display_name, comment.message.body)
# Comments from multiple videos from a user
for video, comments in helix.user('sodapoppin').videos().comments():
for comment in comments:
print(comment.commenter.display_name, comment.message.body)
# Comments from first 5 videos of multiple users
for user, videos in helix.users('sodapoppin', 'reckful').videos(first=5):
for video, comments in videos.comments():
for comment in comments:
print(comment.commenter.display_name, comment.message.body)
```
### Features
- Object oriented
- New Twitch API (Helix)
- VOD chat from Twitch API v5
- Optional cache
---
[Check out Twitch-Chat-Downloader](https://github.com/PetterKraabol/Twitch-Chat-Downloader)
[![Discord](https://user-images.githubusercontent.com/7288322/34471967-1df7808a-efbb-11e7-9088-ed0b04151291.png)](https://discord.gg/wZJFeXC)
`Work in progress`
Twitch Python provides API data to [PetterKraabol/Twitch-Chat-Downloader](https://github.com/PetterKraabol/Twitch-Chat-Downloader).
### Requirements
* [Python 3.6 or newer](https://www.python.org/downloads/)
* [A Twitch client ID](https://dev.twitch.tv/dashboard/apps)
### Usage
```python
import twitch
# Twitch Helix API
helix = twitch.Helix('client-id')
# Multiple users by name and id
for user in helix.users('sodapoppin', 'reckful', 24250859):
print(user.display_name)
# Single user
print(helix.user('zarlach').display_name)
# Videos
for video in helix.videos([318017128, 317650435]):
print(video.title)
# Single video
print(helix.video(318017128).title)
# Video comments
for comment in helix.video(318017128).comments():
print(comment.commenter.display_name)
# Comments from multiple videos
for video, comments in helix.videos([318017128, 317650435]).comments():
for comment in comments:
print(comment.commenter.display_name, comment.message.body)
# Comments from multiple videos from a user
for video, comments in helix.user('sodapoppin').videos().comments():
for comment in comments:
print(comment.commenter.display_name, comment.message.body)
# Comments from first 5 videos of multiple users
for user, videos in helix.users('sodapoppin', 'reckful').videos(first=5):
for video, comments in videos.comments():
for comment in comments:
print(comment.commenter.display_name, comment.message.body)
```
### Features
- Object oriented
- New Twitch API (Helix)
- VOD chat from Twitch API v5
- Optional cache
---
[Check out Twitch-Chat-Downloader](https://github.com/PetterKraabol/Twitch-Chat-Downloader)
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
twitch-python-0.0.1.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for twitch_python-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b9ee8c6458bb3d8777b8ae648a3e4df0d9483e65cc11b9bfb774518f4373184 |
|
MD5 | 2f45ba977675698d2f665ac6de3f4e79 |
|
BLAKE2b-256 | f7388fe4640130440f89e04166b554116d98511d6f26741c1a5acd5904065cd3 |