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.1.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.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

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

Hashes for pymcsrvstatus-1.1.1.tar.gz
Algorithm Hash digest
SHA256 3679e13513c48f14bc7cc6ed69983eb6b884359f0dd33482e40a8414d1d7579a
MD5 fcd7d9442748b3481f76e2ed9d37dc4e
BLAKE2b-256 ee90a038d365754979dae57524f2f3ff03a5a781391415f6d8a002c0e423735c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pymcsrvstatus-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0088ca707e959197c2e6fc0c08f60d212ebc416129cffbc723d95fa8eecc5d94
MD5 2d0d459cd2239920ba275cf786728e1f
BLAKE2b-256 099dd26475bb05685d3a42f6c8042cac2acd28de7b825a269e5a5cd1d094738e

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