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
Metadata
Release files for twitch-python 0.0.20
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 |
|---|---|---|---|---|
| twitch-python-0.0.20.tar.gz | 27.2 kB | Without provenance | Details for twitch-python-0.0.20.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| twitch_python-0.0.20-py3-none-any.whl | Python 3 | none | any | Details for twitch_python-0.0.20-py3-none-any.whl |
Total release size: 57.8 kB
Release files / twitch-python-0.0.20.tar.gz
| Download URL | twitch-python-0.0.20.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e09d7210b8e0abb6892767d722079eb35b14c29e770cdb4df64d569ecbaa17c
|
|
BLAKE2b-256 checksum How to use checksums |
dabb197e2b5e88f3e3408da050b63720d7cf7268bb6fc66140cf625069293cd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / twitch_python-0.0.20-py3-none-any.whl
| Download URL | twitch_python-0.0.20-py3-none-any.whl |
|---|---|
| Size | 30.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8fb28e8484ee8151230998a249f72c878c54fe54bedfa5fbc19f4118b6a5afde
|
|
BLAKE2b-256 checksum How to use checksums |
36fed2b3e273017c62c8a3861c45cb574ec49a6afeaf2e0ba07f7ddbb606911b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for twitch-python 0.0.20
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.