TwitchPy
TwitchPy is a Python package for using the Twitch's API and create bots for interacting with their IRC chats.
Documentation
Click here to see the official documentation.
Installation
TwitchPy requires Python 3.10 or higher. You can download the latest version of Python here.
pip install twitchpy
Getting started
A basic bot.
from datetime import datetime
from twitchpy.bot import Bot
bot = Bot(
"your_oauth_token",
"your_client_id",
"your_client_secret",
"your_redirect_uri",
"tokens_file_path",
"login_of_your_bot",
["channels_list_to_read_from"],
"!",
)
time = datetime.now()
def example_check():
global time
time_diff = datetime.now() - time
if time_diff.seconds >= 5:
bot.me("any_channel_login", "This message is sent every 5 seconds")
time = datetime.now()
def example_listener(message):
if message.user is not None:
bot.me("any_channel_login", f"{message.user} said: {message.text}")
def example_command(message):
bot.me("any_channel_login", f"{message.user} is who called me")
bot.add_check("example_check", example_check)
bot.add_listener("example_listener", example_listener)
bot.add_command("example_command", example_command)
bot.run()
Contributing
TwitchPy currently uses the Black formatter to enforce sensible style formatting.
Before creating a pull request it is encouraged you install and run black on your code.
The line length limit for TwitchPy is 88.
For installation and usage of Black visit: Black Formatter
For integrating Black into your IDE visit: Black IDE Usage
Contact
You can contact me through my e-mail.
Metadata
Release files for twitchpy 1.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| twitchpy-1.3.2.tar.gz | 101.6 kB | Without provenance | Details for twitchpy-1.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| twitchpy-1.3.2-py3-none-any.whl | Python 3 | none | any | Details for twitchpy-1.3.2-py3-none-any.whl |
Total release size: 224.3 kB
Release files / twitchpy-1.3.2.tar.gz
| Download URL | twitchpy-1.3.2.tar.gz |
|---|---|
| Size | 101.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3adc71ff17c8f5e5113d3a3f519d0bcb267d81af7c71604fb470e7cb2de619a
|
|
BLAKE2b-256 checksum How to use checksums |
0df6c4b8b052608947ff94ee86dcaf7b42fea7884884f99d5faea4304901a817
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / twitchpy-1.3.2-py3-none-any.whl
| Download URL | twitchpy-1.3.2-py3-none-any.whl |
|---|---|
| Size | 122.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30f5b051464201afefa5646e33a17a8331830f5a38a673532a39bea37482be8b
|
|
BLAKE2b-256 checksum How to use checksums |
e6a5c3e6ca9b116631430e3047c75128e6973ca7506770c345b249c287ec6dc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for twitchpy 1.3.2
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.