Skip to main content

Twitch Python

Discord Build Status

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

Documentation • Twitch API • Twitch-Chat-Downloader

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)

Source distribution for twitch-python 0.0.20
File Size Uploaded
twitch-python-0.0.20.tar.gz 27.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for twitch-python 0.0.20
File Interpreter ABI Platform
twitch_python-0.0.20-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.0.20 This release

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

3 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

1 release file

0.0.12

1 release file

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

1 release file

0.0.4

1 release file

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page