pymcsrvstatus (2.0.1)
Installation
pip install --index-url pymcsrvstatusAbout this package
An async API wrapper for the mcsrvstat.us API.
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"))
Requirements
Requires Python: >=3.10
Details
Assets (2)
Versions (9)
View all
pymcsrvstatus-2.0.1.tar.gz
3.6 KiB