An extendable client for interacting with Pokemon Showdown
A client for Pokemon Showdown! for Python 3.5+. This was written to make it easier to write bots, interact with users, moderate chat rooms, and collect data.
Install the package with
pip3 install --user showdownpy. This will also install the package's
aiohttp dependencies if you do not already have them.
Examples have been provided in the ./examples directory. Make sure to create your own versions of the login.txt and owner.txt files in ./examples/data/ directory. Example files have been provided.
The client on its own doesn't do very much, and is instead intended to be extended and modified. This can be done through various "hooks" left in the base class. The following program uses the
on_private_message hook to echo back the content of any PMs it receives.
import showdown import logging logging.basicConfig(level=logging.INFO) with open('./examples/data/login.txt', 'rt') as f: username, password = f.read().strip().splitlines() class EchoClient(showdown.Client): async def on_private_message(self, pm): if pm.recipient == self: await pm.reply(pm.content) EchoClient(name=username, password=password).start()
Other hooks include
These hooks are by no means all inclusive (Showdown has somewhere upwards of 40 different types of messages it uses to interact with clients), and so a catch-all hook
on_receive is also present.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size showdownpy-0.1.0-py3-none-any.whl (22.3 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size showdownpy-0.1.0.tar.gz (19.1 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for showdownpy-0.1.0-py3-none-any.whl