Metadata-Version: 2.5
Name: pymcsrvstatus
Version: 2.0.0
Summary: An async API wrapper for the mcsrvstat.us API.
Project-URL: Homepage, https://c.csw.im/cswimr/pymcsrvstatus
Project-URL: Issues, https://c.csw.im/cswimr/pymcsrvstatus/issues
Project-URL: Source Archive, https://c.csw.im/cswimr/pymcsrvstatus/archive/2c8c8b783095a95b6d35ea6cc9e98bb287dec3bd.tar.gz
Author-email: cswimr <cswimr@csw.im>
License-Expression: MPL-2.0
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Requires-Dist: aiohttp>=3.9.5
Requires-Dist: msgspec>=0.21.1
Description-Content-Type: text/markdown

<!--
SPDX-FileCopyrightText: 2025 cswimr <copyright@csw.im>
SPDX-License-Identifier: MPL-2.0
-->

# pymcsrvstatus

[<img alt="Discord" src="https://img.shields.io/discord/1070058354925383681?logo=discord&color=%235661f6&style=plastic">](https://discord.gg/eMUMe77Yb8)
[<img alt="Actions Status" src="https://c.csw.im/cswimr/pymcsrvstatus/badges/workflows/actions.yaml/badge.svg?style=plastic">](https://c.csw.im/cswimr/pymcsrvstatus/actions?workflow=actions.yaml)
[<img alt="PyPI - Version" src="https://img.shields.io/pypi/v/pymcsrvstatus?style=plastic">](https://pypi.org/project/pymcsrvstatus/)
[<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/pymcsrvstatus?style=plastic">](https://pypi.org/project/pymcsrvstatus/)
[<img alt="PyPI - License" src="https://img.shields.io/pypi/l/pymcsrvstatus?style=plastic">](https://c.csw.im/cswimr/pymcsrvstatus/src/tag/v2.0.0/LICENSES/MPL-2.0.txt)

A simple async API wrapper for the [mcsrvstat.us](https://api.mcsrvstat.us") API.

## Usage

```python
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"))
```
