Skip to main content

Twitch module for Python

Project description

Twitch Python

Discord

Work in progress

Twitch Python provides API data to PetterKraabol/Twitch-Chat-Downloader.

Requirements

Usage

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

Project details


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.2.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

twitch_python-0.0.2-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page