Coder Social home page Coder Social logo

klagroix / twitch-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from petterkraabol/twitch-python

1.0 0.0 0.0 161 KB

Object-oriented Twitch API for Python developers

Home Page: https://pypi.org/project/twitch-python

License: MIT License

Python 99.84% Shell 0.16%

twitch-python's Introduction

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

twitch-python's People

Contributors

hokichaio avatar jovocop avatar klagroix avatar petterkraabol avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.