A python library for interacting with Pokémon Showdown
Project description
pslib
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
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
pslib-0.0.6.tar.gz
(8.7 kB
view details)
Built Distribution
pslib-0.0.6-py3-none-any.whl
(10.6 kB
view details)
File details
Details for the file pslib-0.0.6.tar.gz
.
File metadata
- Download URL: pslib-0.0.6.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.0 Linux/4.15.0-1028-gcp
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22a27141870b74ab00085fbbc3b396f74d23c0d5ddab6e1bd3f15047f44412e3 |
|
MD5 | f9b3528f112a905621bca9cb3adbcc1a |
|
BLAKE2b-256 | 7c7f744800fd5ae5fc98f998de003a7020114c1c2e52c4e6201349337d0dd5a7 |
File details
Details for the file pslib-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: pslib-0.0.6-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.8.0 Linux/4.15.0-1028-gcp
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90426eb14429e0768248d21cfac1a99ec58b1bf68f75e8c396d21a7658a71322 |
|
MD5 | d25dea91655a3e96dc71a9b5c1415590 |
|
BLAKE2b-256 | f4ea5ac37fabf8fe537ad762fc714c1b5bddf1ed45033ae467536a9b0129e68a |