Skip to main content

Twitch module for Python

Project description

Twitch Python

Discord

pip install twitch-python

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

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

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
  • New Twitch API (Helix)
  • VOD chat from Twitch API v5
  • Optional cache

DocumentationTwitch APITwitch-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.6.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twitch_python-0.0.6-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file twitch-python-0.0.6.tar.gz.

File metadata

  • Download URL: twitch-python-0.0.6.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for twitch-python-0.0.6.tar.gz
Algorithm Hash digest
SHA256 f4a65407ba0c4502880cba592ea622caeb59910db6abfb648c3bbecaf84ad5aa
MD5 e1346bd6c5f190408ff08ca6cb157482
BLAKE2b-256 846318c2b58bc8ad0cde2fe7375069f52a296b5ffc762ef55cd1d0dbbfa23e99

See more details on using hashes here.

File details

Details for the file twitch_python-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: twitch_python-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for twitch_python-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8edfa0387b53a18f549943014906b9887b7d476530c6ed04622f6708986d1949
MD5 cb8741c0f5ec51401f312024813eee81
BLAKE2b-256 79b8d1f304857950dcfb73b87e045e6af67f0d2d749fba47e49f614fed7ad27b

See more details on using hashes here.

Supported by

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