Skip to main content

An async API wrapper for the mcsrvstat.us API.

Project description

pymcsrvstatus

Discord Actions Status PyPI - Version PyPI - Python Version PyPI - License

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymcsrvstatus-1.1.2-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

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

Hashes for pymcsrvstatus-1.1.2.tar.gz
Algorithm Hash digest
SHA256 3bf5a0332d1c860adc07c22b0de3b877e04c56175ab50f96f338de7331a7d63d
MD5 65b4063884e585f81c28f370fde0396a
BLAKE2b-256 494bf57f86482636da095ea18046d79272d8b7a6ded02a6bb3606e7d5377bbb2

See more details on using hashes here.

File details

Details for the file pymcsrvstatus-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pymcsrvstatus-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cf75830d2fa5f3ea5853024b8710b946e893a975f4d1b00ce78af5bab1d46db0
MD5 5067ce13606c2ec9a2f0f1df96f3f7f3
BLAKE2b-256 71ad5a0b466dc954fd2b19dc6b4171d46f009987e351b0aa616aa2c6b1748ca9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page