Skip to content

klagroix/Twitch-Python

This branch is 13 commits ahead of, 37 commits behind PetterKraabol/Twitch-Python:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f478c33 · Jan 18, 2020

History

68 Commits
Aug 28, 2019
Aug 28, 2019
Jan 18, 2020
Oct 7, 2018
Oct 29, 2018
Aug 3, 2019
Aug 15, 2019
May 26, 2019
May 27, 2019
Aug 25, 2019
Aug 25, 2019
Aug 15, 2019
Jan 11, 2020
Jan 11, 2020

Repository files navigation

NOTE: This has been modified slightly by me (klagroix) and is a work in progress. This updates 'Streams' to allow for pagination.
For original code, license, credit, etc, please refer to this fork's upstream repo: https://github.com/PetterKraabol/Twitch-Python

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')
# 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

DocumentationTwitch APITwitch-Chat-Downloader

About

Object-oriented Twitch API for Python developers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.8%
  • Shell 0.2%