Twitchy
Twitchy is an easy to use Twitch API wrapper with focus on the Helix API, webhooks, and chat.
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.
Reference Links
Twitch Dev Console: https://dev.twitch.tv/
Twitch Helix API Documentation: https://dev.twitch.tv/docs/api/reference
Metadata
Release files for Twitchy 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Twitchy-0.0.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for Twitchy-0.0.1-py2.py3-none-any.whl |
Release files / Twitchy-0.0.1-py2.py3-none-any.whl
| Download URL | Twitchy-0.0.1-py2.py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a904231d4c8198b3c8fbb7100a979a935992f8d4507a1c2302af0b326373848d
|
|
BLAKE2b-256 checksum How to use checksums |
2f4d2899285b1bc31ee5aca9f7f9435a4fe37518ed7084638646da3f86fd3306
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5
|
Security for Twitchy 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.