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.1.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.1.tar.gz.
File metadata
- Download URL: pymcsrvstatus-1.1.1.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 |
3679e13513c48f14bc7cc6ed69983eb6b884359f0dd33482e40a8414d1d7579a
|
|
| MD5 |
fcd7d9442748b3481f76e2ed9d37dc4e
|
|
| BLAKE2b-256 |
ee90a038d365754979dae57524f2f3ff03a5a781391415f6d8a002c0e423735c
|
File details
Details for the file pymcsrvstatus-1.1.1-py3-none-any.whl.
File metadata
- Download URL: pymcsrvstatus-1.1.1-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 |
0088ca707e959197c2e6fc0c08f60d212ebc416129cffbc723d95fa8eecc5d94
|
|
| MD5 |
2d0d459cd2239920ba275cf786728e1f
|
|
| BLAKE2b-256 |
099dd26475bb05685d3a42f6c8042cac2acd28de7b825a269e5a5cd1d094738e
|