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, list=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.3.tar.gz
(9.5 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.3.tar.gz.
File metadata
- Download URL: pymcsrvstatus-1.1.3.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7ea1c687e24719126712c5d1b6f8e47ef33702f65801c89b72c7acca650f1b4
|
|
| MD5 |
3f9663a315bd1747d7912508bea01a51
|
|
| BLAKE2b-256 |
f131d114a6aab9a78b48aeed2d16e502df0548602c650723bc5111089cf72ae3
|
File details
Details for the file pymcsrvstatus-1.1.3-py3-none-any.whl.
File metadata
- Download URL: pymcsrvstatus-1.1.3-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e7a3e2f235d2c36d72fda12e743a20a8488b33e747c288946a45a2940d0dbe3
|
|
| MD5 |
fe9d1230f2f8b0b6a6c18fa48bf0cfeb
|
|
| BLAKE2b-256 |
7f680d7533e0ac48eded5c7c8fdd7483ee2667e22a6104301fcb8ef96e06fc75
|