Skip to main content

An asynchronous Python IRC and API wrapper for Twitch.

Project description

./logo.png?raw=true https://img.shields.io/badge/Python-3.7%20%7C%203.8%20%7C%203.9-blue.svg https://img.shields.io/github/license/TwitchIO/TwitchIO.svg https://img.shields.io/badge/code%20style-black-000000.svg

TwitchIO 2.0 is currently in a BETA stage looking for testers and users. 2.0 supercedes the current 1.2.3 version.

TwitchIO is an asynchronous Python wrapper around the Twitch API and IRC, with a powerful command extension for creating Twitch Chat Bots. TwitchIO 2 will cover 100% of the new Twitch API and will feature support for commands, PubSub and Webhooks.

TwitchIO 2.0 will be buggy, will be lacking some features and you will run into problems here and there, that is the nature of BETA software, by using 2.0 you are helping test and develop TwitchIO by providing us with valuable feedback, feature requests and bug reports.

Documentation

For the Official Documentation: Click Here!

Support

For support using TwitchIO, please join the official support server on Discord.

Discord

Installation

TwitchIO 2 requires Python 3.7+. You can download the latest version of Python here.

Windows

py -3.9 -m pip install -U twitchio

Linux

python3.9 -m pip install -U twitchio

Access Tokens

Visit Token Generator for a simple way to generate tokens for use with TwitchIO.

Getting Started

A simple Chat Bot.

from twitchio.ext import commands


class Bot(commands.Bot):

    def __init__(self):
        # Initialise our Bot with our access token, prefix and a list of channels to join on boot...
        super().__init__(token='ACCESS_TOKEN', prefix='?', initial_channels=['...'])

    async def event_ready(self):
        # We are logged in and ready to chat and use commands...
        print(f'Logged in as | {self.nick}')

    @commands.command()
    async def hello(self, ctx: commands.Context):
        # Send a hello back!
        await ctx.send(f'Hello {ctx.author.name}!')


bot = Bot()
bot.run()

Contributing

TwitchIO 2.0 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 TwitchIO 2.0 is 120.

For installation and usage of Black visit: Black Formatter

For integrating Black into your IDE visit: Black IDE Usage

Special Thanks

Thank you to all those who contribute and help TwitchIO grow.

Special thanks to:

SnowyLuma

Harmon

Tom

Tesence

Adure

Scragly

If I have forgotten anyone please let me know <3: EvieePy

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

twitchio-2.0.2.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

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

twitchio-2.0.2-py3-none-any.whl (82.6 kB view details)

Uploaded Python 3

File details

Details for the file twitchio-2.0.2.tar.gz.

File metadata

  • Download URL: twitchio-2.0.2.tar.gz
  • Upload date:
  • Size: 54.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for twitchio-2.0.2.tar.gz
Algorithm Hash digest
SHA256 ab31e7011e4003563d640d3b52505f48237ed165d8f1fac61e076546072b0986
MD5 88c95aba2f9c71e244345b31cdd98b80
BLAKE2b-256 3349a1fecccb80721f27884e4eafec7cbedfedf3e883dd29e568a4dc32fd3ce3

See more details on using hashes here.

File details

Details for the file twitchio-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: twitchio-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 82.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for twitchio-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e50e3dcd2a0f302cc3be25cdc7d148452b9dc3a773554bd687e7340d5bd2d5c8
MD5 e4d56722d5e5f4df39b9da8694ceb288
BLAKE2b-256 313774d35d6ded59547052da7c70ee60eed7ab72fbe189c7139aa3ab1760eae0

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