Python MCStatus is a library which wraps around the mcstatus.io API. It is developed very similar to the node-mcstatus npm package. It's essentially the same just ported to python.
Table of Contents
To install this package open your terminal for your workspace and use the following command:
pip install python-mcstatus
from python_mcstatus import JavaStatusResponse, statusJava
host = 'demo.mcstatus.io'
port = 25565
query = True
response: JavaStatusResponse = statusJava(host, port, query) # port is optional and defaults to 25565
# You can receive and error in the above when the response is not 200, this copies the functionality from the node library.
from python_mcstatus import BedrockStatusResponse, statusBedrock
host = 'demo.mcstatus.io'
port = 19132
response: BedrockStatusResponse = statusBedrock(host, port) # port argument is optional and defaults to 19132
python-mcstatus
is distributed under the terms of the MIT license.