An async API wrapper for the mcsrvstat.us API.
Project description
pymcsrvstatus
A simple async API wrapper for the mcsrvstat.us API.
Usage
from pymcsrvstatus import check_if_online, fetch, get_icon_url
import asyncio
async def example(address: str) -> None:
if await check_if_online(address, extra_user_agent="pymcsrvstatus example"):
print("Hypixel is online!")
else:
print("Hypixel is offline!")
status = await fetch(address, extra_user_agent="pymcsrvstatus example")
assert status.online is True
print(status.protocol) # Protocol(version=47, name="1.8.9")
print(status.version) # "Requires MC 1.8 / 1.21"
print(status.players) # Players(online=33812, max=200000, players=None)
print(get_icon_url(address)) # https://api.mcsrvstat.us/icon/hypixel.net
asyncio.run(example(address="hypixel.net"))
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
pymcsrvstatus-1.1.2.tar.gz
(9.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymcsrvstatus-1.1.2.tar.gz.
File metadata
- Download URL: pymcsrvstatus-1.1.2.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bf5a0332d1c860adc07c22b0de3b877e04c56175ab50f96f338de7331a7d63d
|
|
| MD5 |
65b4063884e585f81c28f370fde0396a
|
|
| BLAKE2b-256 |
494bf57f86482636da095ea18046d79272d8b7a6ded02a6bb3606e7d5377bbb2
|
File details
Details for the file pymcsrvstatus-1.1.2-py3-none-any.whl.
File metadata
- Download URL: pymcsrvstatus-1.1.2-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf75830d2fa5f3ea5853024b8710b946e893a975f4d1b00ce78af5bab1d46db0
|
|
| MD5 |
5067ce13606c2ec9a2f0f1df96f3f7f3
|
|
| BLAKE2b-256 |
71ad5a0b466dc954fd2b19dc6b4171d46f009987e351b0aa616aa2c6b1748ca9
|