A simple async API wrapper for the mcsrvstat.us API.
https://pypi.org/project/pymcsrvstatus
- Python 76.2%
- Nix 23.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Actions / Build (push) Successful in 36s
Actions / Lint (Python 3.10) (push) Successful in 34s
Actions / Lint (Python 3.12) (push) Successful in 30s
Actions / Lint (Python 3.11) (push) Successful in 35s
Actions / Lint (Python 3.13) (push) Successful in 34s
Actions / Lint (Python 3.14) (push) Successful in 32s
|
||
| .forgejo/workflows | ||
| .zed | ||
| LICENSES | ||
| pymcsrvstatus | ||
| .envrc | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| pyproject.toml | ||
| README.md | ||
| renovate.json | ||
| REUSE.toml | ||
| uv.lock | ||
pymcsrvstatus
A simple async API wrapper for the mcsrvstat.us API.
Usage
import asyncio
from pymcsrvstatus import McSrvStatusClient
async def example(address: str) -> None:
async with McSrvStatusClient(extra_user_agent="pymcsrvstatus example") as client:
if await client.check_if_online(address):
print("Wynncraft is online!")
else:
print("Wynncraft is offline!")
status = await client.fetch(address)
assert status.online is True
print(status.protocol) # Protocol(version=769, name='1.21.4')
print(status.version) # "1.21.4+"
print(status.players) # Players(online=2704, max=3500, players=[])
print(client.get_icon_url(address)) # play.wynncraft.com
asyncio.run(example(address="play.wynncraft.com"))