Skip to content
/ pslib Public

A python library for interacting with Pokémon Showdown.

License

Notifications You must be signed in to change notification settings

vberlier/pslib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pslib

Build Status PyPI PyPI - Python Version

A python library for interacting with Pokémon Showdown.

🚧 Work in progress 🚧

import asyncio
import pslib

async def join_battles(client):
    while True:
        for battle in await client.query_battles():
            try:
                await battle.join()
            except pslib.JoiningRoomFailed:
                pass

async def display_logs(client):
    async for message in client.listen(pslib.WinMessage, all_rooms=True):
        print(message.room.logs)
        await message.room.leave()

async def main():
    async with pslib.connect() as client:
        await asyncio.gather(join_battles(client), display_logs(client))

asyncio.run(main())

Installation

The package can be installed with pip.

$ pip install pslib

License - MIT

About

A python library for interacting with Pokémon Showdown.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages