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, 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)

Uploaded Source

Built Distribution

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

pymcsrvstatus-1.1.3-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

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

Hashes for pymcsrvstatus-1.1.3.tar.gz
Algorithm Hash digest
SHA256 c7ea1c687e24719126712c5d1b6f8e47ef33702f65801c89b72c7acca650f1b4
MD5 3f9663a315bd1747d7912508bea01a51
BLAKE2b-256 f131d114a6aab9a78b48aeed2d16e502df0548602c650723bc5111089cf72ae3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymcsrvstatus-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3e7a3e2f235d2c36d72fda12e743a20a8488b33e747c288946a45a2940d0dbe3
MD5 fe9d1230f2f8b0b6a6c18fa48bf0cfeb
BLAKE2b-256 7f680d7533e0ac48eded5c7c8fdd7483ee2667e22a6104301fcb8ef96e06fc75

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