Saravanan666/pypi-org huggingface dataset:
Package: twitchio
TwitchIO is an asynchronous Python wrapper around the Twitch API and IRC, with a powerful command extension for creating Twitch Chat Bots. TwitchIO covers almost all of the new Twitch API and features support for commands, PubSub, Webhooks, and EventSub.DocumentationFor the Official Documentation:Click Here!SupportFor support using TwitchIO, please join the officialsupport serveronDiscord.InstallationTwitchIO requiresPython 3.7+. You can download the latest version of Pythonhere.Windowspy-mpipinstall-UtwitchioLinuxpython-mpipinstall-UtwitchioAccess TokensVisitToken Generatorfor a simple way to generate tokens for use with TwitchIO.Getting StartedA simple Chat Bot.fromtwitchio.extimportcommandsclassBot(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=['...'])asyncdefevent_ready(self):# We are logged in and ready to chat and use commands...print(f'Logged in as |{self.nick}')print(f'User id is |{self.user_id}')@commands.command()asyncdefhello(self,ctx:commands.Context):# Send a hello back!awaitctx.send(f'Hello{ctx.author.name}!')bot=Bot()bot.run()ContributingTwitchIO currently uses theBlackformatter 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 is120.For installation and usage of Black visit:Black FormatterFor integrating Black into your IDE visit:Black IDE UsageSpecial ThanksThank you to all those who contribute and help TwitchIO grow.Special thanks to:SnowyLumaHarmonTomTesenceAdureScraglyChillymoshIf I have forgotten anyone please let me know <3:EvieePy
Package: twitchirc-drgreengiant
TwitchIRCThis module connects to the Twitch IRC as a basic listener client.  It handles the ping pong and initial connection but otherwise does not send anything to Twitch therefore does not appear in the viewer list nor can it post to chat.  As such, no oauth is required, it just works out of the box.It can join multiple channels at the same time and will report which channel a message was received in.InstallationAvailable on PyPi athttps://pypi.org/project/twitchirc-drgreengiant/pipinstalltwitchirc_drgreengiantTypical Usagefromtwitchirc_drgreengiantimporttwitchircchannels=frozenset(["drgreengiant","hpxdreamer"])withtwitchirc.TwitchIrc(channels)asirc:whileTrue:msg=irc.get_message(irc)ifnotmsg:continueprint("Received a message:")print(f"{msg.channel=}from{msg.username=}")print(f"{msg.payload=}")print()
Package: twitchircpy
twitchircpytwitchircpy is a wrapper for the Twitch IRC used for creating chat bots.InstallingInstalling from PyPI:pip install twitchircpyInstalling from source:pip install git+https://github.com/IsaacAKAJupiter/twitchircpy.gitYou might have to install with these commands if the above installs for Python 2.pip3 install twitchircpy
pip3 install git+https://github.com/IsaacAKAJupiter/twitchircpy.gitDocumentation/Wikihttps://github.com/IsaacAKAJupiter/twitchircpy/wikiSmall Exampleimporttwitchircpybot=twitchircpy.Bot("oauth","nick","!","jups",True)@bot.eventdefon_connect():print("Connected!")@bot.eventdefon_message(message):if"HeyGuys"inmessage.content:bot.send_message(message.channel,f"@{message.user}HeyGuys")@bot.eventdefon_sub(sub):bot.send_message(sub.channel,f"Thank you @{sub.login}for subbing!")bot.start()You can find examples in the examples directory.Library RequirementsGood news! This library only uses built-in Python libraries.Python VersionTested with Python 3.7DiscordPlease join theDiscordif you need help with the library or just want to chat!
Package: twitch-MagicaFreak
TwitchAPI WrapperA Twitch Wrapper for Python 3.6 or higher for the new Twitch API with its App TokenInstallationpip install twitch-MagicaFreakGetting StartedTo start a session with Twitch you just use:from twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:Now to get something from the Twitch App you just use your name and the function you want.
As an example:from twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:
    await example_name.user('MagicaFreak')##Functions
All the functions that exist at the momentTwitch UserIt gets the user by his usernamefrom twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:
    await example_name.user('Username')This can be done for multiple users toofrom twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:
    await example_name.user(['Username1', 'Username2', 'Username3'])And it returns a list of users that you searched forTwitch StreamIt gets the stream that is live by the name of the streamerfrom twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:
    await example_name.stream('Streamername')This can be done for multiple streams toofrom twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:
    await example_name.stream(['Streamername1', 'Streamername2', 'Streamername3'])And it returns a list of streams that you searched forTwitch TagsIt gets the tag by the tag IDfrom twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:
    await example_name.tag('tag ID')This can be done for multiple tags toofrom twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:
    await example_name.tag(['tagID1', 'tagID2', 'tagID3'])And it returns a list of tags that you searched forTwitch gameIt gets the game by its namefrom twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:
    await example_name.game('game name')This can be done for multiple games toofrom twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:
    await example_name.game(['gamename1', 'gamename2', 'gamename3'])And it returns a list of the games that you searched forTwitch Top GamesIt gets the top games of the momentfrom twitch.twitch import Twitch

async with Twitch("client_id","client_secret") as example_name:
    await example_name.top_games()And it returns a list of the top games
Package: twitchobserver
twitchobserver makes interacting with Twitch chat super easy. It is
built and tuned for realtime applications. You can make chatbots chat.
You can buildTwitch Playsvideo games.FeaturesPure Python:No extra dependencies. Just plain and simple Python.Small API:With a few classes and a handful of methods, you can
learn it over a coffee break.Event Based:Makes writing apps easy and straightforward.Context Manager:Further simplifies working with observers.Installation$ pip install twitchobserverUsagefromtwitchobserverimportObserverobserver=Observer('Nick','oauth:abcdefghijklmnopqrstuvwxyz0123')observer.start()observer.join_channel('channel')observer.send_message('Hello and goodbye','channel')observer.leave_channel('channel')DocumentationAPI documentation can be found over onReadtheDocs.org.Tests$ python-munittest discover-stestsExamplesEcho botWhenever a message is sent, echo it back. TheObserveris created as
acontext manager objectwhich will implicitly handle callingstart()andstop().importtimefromtwitchobserverimportObserverwithObserver('Nick','oauth:abcdefghijklmnopqrstuvwxyz0123')asobserver:observer.join_channel('channel')whileTrue:try:foreventinobserver.get_events():ifevent.type=='TWITCHCHATMESSAGE':observer.send_message(event.message,event.channel)time.sleep(1)exceptKeyboardInterrupt:observer.leave_channel('channel')breakMore examples can be found in theCookbook.LicenseMIT
Package: twitch-plays-hackru
Twitch Plays hackRUtwitch_plays_hackru is a Python library for twitch chatters to be able to vote on commands in a game.Installationpip3 install twitch_plays_hackru.UsageImporting the classes:fromtwitch_plays_hackruimportTwitchPlaysOnline,TwitchPlaysOfflineInitializing the TwitchPlaysOnline or TwitchPlaysOffline object:twitch_options={"PASS":"oauth:YOUR_OATH_CODE_HERE","BOT":"TwitchPlaysBot","CHANNEL":"YOUR_CHANNEL_NAME_HERE","OWNER":"YOUR_CHANNEL_NAME_HERE","OPTIONS":["1","2","3","hi","bye"],"VOTE_INTERVAL":5}tPlays=TwitchPlaysOnline(**twitch_options)# ortPlays=TwitchPlaysOnline(PASS="oauth:YOUR_OATH_CODE_HERE",BOT="TwitchPlaysBot",CHANNEL="YOUR_CHANNEL_NAME_HERE",OWNER="YOUR_CHANNEL_NAME_HERE",OPTIONS=["1","2","3","hi","bye"],VOTE_INTERVAL=5)The object will take in7 parameters:only VOTE_INTERVAL and OPTIONS are needed for the offline version
SERVER: the server that the bot will be interacting with. In this case it will always be "irc.twitch.tv" (the default)PORT: the port you would like use. defaults to 6667PASS: the OAuth code for the twitch channel you would like this bot to listen on. Usetwitchapp.com/tmi/to generate the OAuth code for your twitch channel.BOT: the nickname of the bot.CHANNEL: the name of the channel you would like this bot to listen on.OWNER: the username of the owner of the channel you would like this bot to listen on.OPTIONS = []: an array of options that you would like the bot to keep track of.
VOTE_INTERVAL: how often you want to count up the votes. defaults to every 5 secondsChatters voting:The initialization of the bot will also startup the bot. This means that the bot will send a "Hello World" message in the chat and then begin to listen to all of the chat responses.Chatters will preface their vote option by usingplay_. For example, a vote forhifrom the code above must be typedplay_hi. It is not case sensitive.Functions:vote_results():result=tPlays.vote_results()vote_results() returns the majority vote since the last count. if a count has not been completed it will return null
the whole idea behind this library is that vote_results acts like pygame.key.get_pressed() which makes
it easy to develop a game withLicenseGNU
Package: twitchplays-retroarch
twitchplays-retroarchTwitch Plays application for RetroArch/FBNeo, with input queue and chat control toggle shortcut.Commissioned by twitch.tv/LastTimeLord.Made withtwitchioandPyAutoGUI(PyDirectInputwhen on Windows).Informed bycontrolmypcand DougDoug's Twitch Plays projects.Features:Input queue - commands are processed with a queue system and always executed in the order they're sent.Hotkeys - add global hotkeys (will work when not focused on the program window) for pausing chat control. Powered bykeyboard.Scalable - can use a thread pool to execute multiple inputs simultaneously.Customisable - change settings and commands inconfig.toml.Bot commands - try!helpAutomatically locate RetroArch's config file and use your controls settings to make command templates for this program.Installation and Usage:Download as an exeIf you want the easiest way to use this on Windows without knowing about or installing Python, you can go to thereleases pageon GitHub, select the latest one, and download thetwitchplays-retroarch.exefile from the Assets section.You can then run it from where ever you downloaded it.Install with pip from PyPIThis project is on PyPI:https://pypi.org/project/twitchplays-retroarch/Just usepip install twitchplays-retroarch.After it's installed you can run itpython -m twitchplays_retroarchor justtwitchplays-retroarch.You can also access its classes and functions withimport twitchplays_retroarch.Clone from GitHubThe usual:git clone https://github.com/JMcB17/twitchplays-retroarchcd twitchplays-retroarchpip install -r requirements.txtThen you can usepython -m twitchplays_retroarch(from within this folder only).General UsageRun the program for the first time, and it will prompt you to allow it to automatically create a new templateconfig.tomlfile.Open the file in a text editor. It's annotated with what each setting means.The most important settings are at the start of the file under the[twitch]header. You'll need to set them in order to run the bot successfully.After that, you can read and edit the other settings if you want more customisation.You can also run the program with the-hcommand line flag for info.
Package: twitch-python
Twitch Pythonpip install --user twitch-pythonAn object-oriented approach to accessing the Twitch API and live chat with relationships and smart caching.RequirementsPython 3.10 or newerA Twitch client IDUsage# Twitch APIimporttwitchhelix=twitch.Helix('client-id','client-secret')# Usersforuserinhelix.users(['sodapoppin','reckful',24250859]):print(user.display_name)print(helix.user('zarlach').display_name)# Videosforvideoinhelix.videos([318017128,317650435]):print(video.title)print(helix.video(318017128).title)# Video Comments (VOD chat)forcommentinhelix.video(318017128).comments:print(comment.commenter.display_name)forvideo,commentsinhelix.videos([318017128,317650435]).comments:forcommentincomments:print(comment.commenter.display_name,comment.message.body)forvideo,commentsinhelix.user('sodapoppin').videos().comments:forcommentincomments:print(comment.commenter.display_name,comment.message.body)foruser,videosinhelix.users(['sodapoppin','reckful']).videos(first=5):forvideo,commentsinvideos.comments:forcommentincomments:print(comment.commenter.display_name,comment.message.body)# Twitch Chattwitch.Chat(channel='#sodapoppin',nickname='zarlach',oauth='oauth:xxxxxx').subscribe(lambdamessage:print(message.channel,message.user.display_name,message.text))FeaturesObject-oriented relationshipsSmart cachingNew Twitch API (Helix)VOD chat from Twitch API v5Documentation•Twitch API•Twitch-Chat-Downloader
Package: twitchrealtimehandler
DescriptionThis package allows to extract in real-time frames or audio segments of a twitch stream as a numpy array.
It heavily relies on FFmpeg to decode on-the-fly and asynchronously the stream.
Then the package stocks the frames or the audio segments into a fifo.RequirementsFFmpegpython 3.7+This code has only been tested on Ubuntu 20.04, it might requires some tweaks to make it compatible with Windows or MacOSXInstallationInstall using pip for stable release,pipinstalltwitchrealtimehandlerFor latest development release,pipinstallgit+git://github.com:adrz/twitch-realtime-handler.gitUsagefromtwitchrealtimehandlerimport(TwitchAudioGrabber,TwitchImageGrabber)importnumpyasnpaudio_grabber=TwitchAudioGrabber(twitch_url="https://www.twitch.tv/jeanmassietaccropolis",blocking=True,# wait until a segment is availablesegment_length=2,# segment length in secondsrate=16000,# sampling rate of the audiochannels=2,# number of channelsdtype=np.int16# quality of the audio could be [np.int16, np.int32, np.float32, np.float64])audio_segment=audio_grabber.grab()audio_grabber.terminate()# stop the transcodingimage_grabber=TwitchImageGrabber(twitch_url="https://www.twitch.tv/jeanmassietaccropolis",quality="480p",# quality of the stream could be ["160p", "360p", "480p", "720p", "720p60", "1080p", "1080p60"]blocking=True,rate=10# frame per rate (fps))frame=image_grabber.grab()image_grabber.terminate()# stop the transcodingExamplesRequirementsDependencies for face_recognition package:sudoapt-getupdate
sudoapt-getinstallbuild-essentialcmake
sudoapt-getinstalllibopenblas-devliblapack-devsudoapt-getinstalllibx11-devlibgtk-3-dev
sudoapt-getinstallpython3python3-devpython3-pip
pipinstall-rrequirements-examples.txtReal-time face detectionpythonexamples/realtime-face-detection.py--twitch-urlhttps://twitch.tv/yourfavouritetwitcherReal-time transcriptpythonexamples/realtime-transcript.py--twitch-urlhttps://twitch.tv/yourfavouritetwitcherKnown issuesIf you encounter this image, it means that twitch knows your not watching from its website. You'll get this message for a few seconds and the stream will resume.
Package: twitch-talkbot
Twitch TalkbotA twitch bot for streamers who can’t / don’t want to speak. Uses the standard TTS
engine for your OS to convert text you type into audible speech. Talkbot will
see everything you type in the twitch chat, and will speak it. Additionally,
you may type text into the prompt you get when you run Talkbot locally on your PC,
and this text will be spoken too, and also simultaneously sent to the twitch chat
as if you typed it in there.Setup instructionsFirst-time setupYou only need to do this stuff once.InstallPython 3.7Open a Command Prompt or a terminal and type the following command to install
twitch_talkbot:python -m pip install twitch_talkbotOnce the installation command completes, type the following command to
run Talkbot:python -m twitch_talkbotSince you do not have a configuration file yet, running the above command
should result in the following output:Unable to find config file. Created default in 'xxxx.json', please
enter appropriate values and re-run.Open the default configuraton file that was created for you atxxxx.json,
and ensure the following parameters are set:"twitch_auth_token": ensure this is set to the OAuth token for the
twitch account you want the bot to use
(e.g."twitch_auth_token": "oauth:blahblahblahblahblah").Generate an OAuth token here(you will need
to log in to the twitch account you plan to use)."twitch_bot_account": Ensure this is set to the name of the twitch account
you want to the bot to log in with (e.g."twitch_bot_account": "endremia")."twitch_client_id": Ensure this is set to the client ID for your
registered application (e.g."twitch_client_id": "blahblahblahblah").Register a new application here(Set “OAuth redirect URLs” tohttp://localhost).That’s it, you’re done, and hopefully you never have to do those things again.Running the botEvery time you want to start twitch_talkbot, open a Command Prompt or terminal and
type the following command:python -m twitch_talkbotNow, the bot is running and you can type commands or text to speak into the
command prompt window, or into the twitch chat window.
Package: twitch-thumbnail
twitch-thumbnailDownload Twitch channel thumbnailInstallpipinstalltwitch-thumbnailRequire FFMPEGUsagesynchronousfromtwitch_thumbnailimportdownload_thumbnaildownload_thumbnail("woowakgood","thumbnail.png")asynchronousimportasynciofromtwitch_thumbnail.asynchronousimportdownload_thumbnailasyncdefmain():awaitdownload_thumbnail("woowakgood","thumbnail.png")asyncio.run(main())Twitch OAuth Tokenhttps://twitch.tv-> Devtools Consoledocument.cookie.split("; ").find((item)=>item.startsWith("auth-token="))?.split("=")[1];download_thumbnail("woowakgood","thumbnail.png",twitch_oauth="your-personal-oauth-token")
Package: twitch-to-clip
Twitch-To-ClipCLI tool that allows you to download Twitch clips or highlight videos and convert them into vertical videos ideal for TikTok and YouTube shorts.
It uses thetwitch-dland ffmpeg packages to achieve this.InstallationYou can install using pip. Open your terminal and run the following command:pipinstalltwitch-to-clipRequirementsPython 3.7 or higher installed on your systemffmpeg, installed and on the system pathTo check if ffmpeg is properly installed on your system, open your terminal and run the following command:ffmpeg-versionIf ffmpeg is installed and added to the system path, it will display the version information.UsageTo use the package, run the twitch-to-clip command followed by the Twitch clip or highlight URL/s you want to download and convert into vertical video.twitch-to-clip"twitch clip or highlight URL/s"Supports the following custom arguments:--output (-o) : Specify the output file name--twitchdl : Add additional arguments to the twitch-dl download command. Encase in quotes.--ffmpeg : Optional ffmpeg command to apply to videos. Encase in quotes.Usage:twitch-to-clip[-h][--outputOUTPUT][--twitchdlTWITCHDL][--ffmpegFFMPEG]urls[urls...]Createverticalvideosfromtwitchclips

positionalarguments:urlsTwitchcliporhighlighturl/s

optionalarguments:-h,--helpshowthishelpmessageandexit--outputOUTPUT,-oOUTPUTOutputfilename--twitchdlTWITCHDLArgumentstopasstotwitchdldownload.Encaseinquotes.--ffmpegFFMPEGOptionalffmpegcommandtoapplytovideos.Encaseinquotes.ExampleTo download and convert a Twitch clip to a vertical video, run the following command:twitch-to-clip"https://www.twitch.tv/jerma985/clip/ScaryLittleKleePoooound-chk_kaV2M2xZuzV5"You can also specify the output file name using the --output (-o) argument:twitch-to-clip"https://www.twitch.tv/jerma985/clip/ScaryLittleKleePoooound-chk_kaV2M2xZuzV5"-omyclip.mp4If you want to add additional arguments that can be passed throught to the twitch-dl download command or apply an optional ffmpeg command to the downloaded video, you can use the --twitchdl and --ffmpeg arguments respectively.twitch-to-clip"https://www.twitch.tv/jerma985/clip/ScaryLittleKleePoooound-chk_kaV2M2xZuzV5"--twitchdl"-q 720p"--ffmpeg"-af highpass=f=100 \"output.mp4\""Useful Linkshttps://twitch-dl.bezdomni.net/https://ffmpeg.org/AuthorThis package was created by Emmanuil B.LicenseCopyright 2023 Emmanuil Borovikovshttps://eb1811.github.io/Licensed under the GPLv3:http://www.gnu.org/licenses/gpl-3.0.html
Package: twitch-tools
Twitch ToolsInstalation```
pip install twitch_tools
```UsageFollowing a user on twitch:fromtwitch_toolsimportfollowfollow("<username>","<account token>")Unfollowing a user on twitch:fromtwitch_toolsimportunfollowunfollow("<username>","<account token>")Sending a friend request to a user on twitch:fromtwitch_toolsimportfriendfriend("<username>","<account token>")
Package: twitchview
Simple program by python for watching favorite twitch channelsDepends:vlc -http://www.videolan.org/vlc/m3u8 -https://github.com/globocom/m3u8Pillow -https://github.com/python-pillow/PillowQuick InstallDebian/Ubuntu
   sudo apt install vlc pip python-tk
   sudo pip3 install twitchviewWin
   Download and install Python, VLC
   pip3 install twitchviewMaxOS X
   sudo pip3 install twitchviewPython3.0 or latest package0.6.8 - Removed livestream0.6.7 - Fix twitch API0.6.6 - Fix urlquote0.6.5 - Fix https request0.6.4 - Fix restart button0.6.3 - Fix quit and irc chat0.6.2 - Fix encodings in chat0.6.1 - Migrate to Python30.5.7 - Added IRC chat0.5.3 - Added gitlab-CI to deploy on pypi hosting