Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vberlier/pslib
A python library for interacting with Pokémon Showdown.
https://github.com/vberlier/pslib
client pokemon-showdown pokemon-showdown-bot pslib websockets
Last synced: 6 days ago
JSON representation
A python library for interacting with Pokémon Showdown.
- Host: GitHub
- URL: https://github.com/vberlier/pslib
- Owner: vberlier
- License: mit
- Created: 2020-03-28T22:28:38.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T04:53:56.000Z (over 3 years ago)
- Last Synced: 2024-10-02T06:43:30.216Z (about 2 months ago)
- Topics: client, pokemon-showdown, pokemon-showdown-bot, pslib, websockets
- Language: Python
- Size: 474 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# pslib
[![Build Status](https://travis-ci.com/vberlier/pslib.svg?branch=master)](https://travis-ci.com/vberlier/pslib)
[![PyPI](https://img.shields.io/pypi/v/pslib.svg)](https://pypi.org/project/pslib/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pslib.svg)](https://pypi.org/project/pslib/)> A python library for interacting with Pokémon Showdown.
**🚧 Work in progress 🚧**
```python
import asyncio
import pslibasync def join_battles(client):
while True:
for battle in await client.query_battles():
try:
await battle.join()
except pslib.JoiningRoomFailed:
passasync 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`.
```bash
$ pip install pslib
```---
License - [MIT](https://github.com/vberlier/pslib/blob/master/LICENSE)