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
if asyncio.run(check_if_online(address="hypixel.net", extra_user_agent="pymcsrvstatus example")):
print("Hypixel is online!")
else:
print("Hypixel is offline!")
status = asyncio.run(fetch(address="hypixel.net", 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="hypixel.net")) # https://api.mcsrvstat.us/icon/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.0.3.tar.gz
(9.3 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.0.3.tar.gz.
File metadata
- Download URL: pymcsrvstatus-1.0.3.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b440f73a46f1fad3519a52b3addf2e7268e40ced876547367204efd72971036
|
|
| MD5 |
f7bdbfae790805249d0a5501807c1706
|
|
| BLAKE2b-256 |
38a53b5a79d8b73886335b3901d38c8b6bcd83fd413f6267497a06c10946ddc1
|
File details
Details for the file pymcsrvstatus-1.0.3-py3-none-any.whl.
File metadata
- Download URL: pymcsrvstatus-1.0.3-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc532e2b1f305935e8c3add23c679f3678adf16e3b4359e183fdbde42ac96d2b
|
|
| MD5 |
14ed8884ed736342958532faf0eec9c0
|
|
| BLAKE2b-256 |
602c6abec6dd34b25ae7510ba66e06d3645534ecbb1136308ecbcd9fc5f72208
|