A simple Python library for interacting with the my-mc.link API.
Thanks to MiTask for creating MyMC-Java-Lib from where i got the info of the api endpoints, and inspired me to create this.
This project is licensed under the GNU Affero General Public License v3.0 (AGPLv3).
See the LICENSE file for details.
Install via pip (after publishing to PyPI):
pip install MyMcPy
Or install directly from source:
pip install .
from mymcpy import MyMcPy
# Initialize with your API token
client = MyMcPy("your_token_here")
# Get server stats
stats = client.get_stats()
print(stats)
# Ban a player
result = client.post_ban("Steve")
print(result)
# List online players
players = client.get_online_players()
print(players)
get_stats()- Get server statisticsget_online_players()- List online playerspost_ban(username)- Ban a player by usernamepost_unban(username)- Unban a playerpost_say(message)- Send a chat messagepost_tell(username, message)- Send a private messagepost_console(command)- Execute a console commandinstall_mod(mod_id)- Install a mod by IDuninstall_mod(mod_id)- Uninstall a mod by ID- ...and more!
See the source code for the full list of available methods.
Contributions are welcome! Please open issues or pull requests.