Skip to main content

Twitchy is an easy to use Twitch API wrapper with focus on the Helix API, webhooks, and chat.

Project description

Twitchy is an easy to use Twitch API wrapper with focus on the Helix API, webhooks, and chat.

https://user-images.githubusercontent.com/7674344/100273792-5ae52d00-2f2b-11eb-9710-588aeec63a50.png

Requirements

  • Python 3.5 or newer

  • Twitch API Credentials

Installation

pip install twitchy

Usage

from twitchy import Helix

twitch = Helix(client_id="****", oauth_token="****")

me = twitch.get_user()

print(me.id)
print(me.display_name)

Quickstart

Authentication

In January 2020, Twitch made a change that requires all requests to be accompanied by a User Access Token or an App Access Token.

To authenticate as a user, provide the OAuth token when instantiating Helix.

from twitchy import Helix

twitch = Helix(client_id="****", oauth_token="****")

To authenticate using an App Access Token, just provide the Client ID and Client Secret, and Twitchy will handle authorization for you when necessary.

from twitchy import Helix

twitch = Helix(client_id="****", client_secret="****")

To get a Client ID and Client Secret, register an app on the Twitch Dev Console.

Making Requests

Methods on the Helix class will all be named as obviously as possible by naming them after the Twitch Helix endpoint they’re interfacing with. You can find examples in our examples folder.

Reference for Twitch Helix endpoints can be found in the Twitch Helix API documentation.

Contributing

Requirements:

  • Commitizen: Commit message consistency.

  • pre-commit: For interfacing with pre-commit git hooks.

  • Black: Code formatting.

  • PyLint: Code linting.

When writing a commit, be sure to use git commit without the -m to open the commitizen cli.

Steps to Contribute:

  • Fork the repo and create your branch from main.

  • If you’ve added any code that should be tested, add tests.

  • If an issue doesn’t exist yet, create an issue for tracking purposes.

  • Open a Pull Request referencing the issue # in the message body.

If contributing user-facing methods, be sure to use the included docstringsTemplate mustache config for docstrings either via editor extension, or manual process.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Twitchy-0.0.1-py2.py3-none-any.whl (13.4 kB view hashes)

Uploaded Python 2 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