Twitch module for Python
Project description
Twitch Python
pip install --user twitch-python
An object-oriented approach to accessing the Twitch API and live chat with relationships and smart caching.
Requirements
Usage
# Twitch API
import twitch
helix = twitch.Helix('client-id', 'client-secret')
# Users
for user in helix.users(['sodapoppin', 'reckful', 24250859]):
print(user.display_name)
print(helix.user('zarlach').display_name)
# Videos
for video in helix.videos([318017128, 317650435]):
print(video.title)
print(helix.video(318017128).title)
# Video Comments (VOD chat)
for comment in helix.video(318017128).comments:
print(comment.commenter.display_name)
for video, comments in helix.videos([318017128, 317650435]).comments:
for comment in comments:
print(comment.commenter.display_name, comment.message.body)
for video, comments in helix.user('sodapoppin').videos().comments:
for comment in comments:
print(comment.commenter.display_name, comment.message.body)
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)
# Twitch Chat
twitch.Chat(channel='#sodapoppin', nickname='zarlach', oauth='oauth:xxxxxx').subscribe(
lambda message: print(message.channel, message.user.display_name, message.text))
Features
- Object-oriented relationships
- Smart caching
- New Twitch API (Helix)
- VOD chat from Twitch API v5
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.20.tar.gz
(27.2 kB
view details)
Built Distribution
File details
Details for the file twitch-python-0.0.20.tar.gz
.
File metadata
- Download URL: twitch-python-0.0.20.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e09d7210b8e0abb6892767d722079eb35b14c29e770cdb4df64d569ecbaa17c |
|
MD5 | 53770f107a6da3f7ae954408a26b831a |
|
BLAKE2b-256 | dabb197e2b5e88f3e3408da050b63720d7cf7268bb6fc66140cf625069293cd9 |
File details
Details for the file twitch_python-0.0.20-py3-none-any.whl
.
File metadata
- Download URL: twitch_python-0.0.20-py3-none-any.whl
- Upload date:
- Size: 30.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fb28e8484ee8151230998a249f72c878c54fe54bedfa5fbc19f4118b6a5afde |
|
MD5 | 30cf97ad5d88a669e28997b9fc3589e1 |
|
BLAKE2b-256 | 36fed2b3e273017c62c8a3861c45cb574ec49a6afeaf2e0ba07f7ddbb606911b |