Object-oriented Python client for the Minestrator API
Project description
minestrator-api
Object-oriented Python client for the Minestrator API.
This project is designed as a clean pip package with a readable multi-file architecture.
Features
- Clean package layout ready for publishing on PyPI.
- Typed models for servers, players, files, addons, and stats.
- Automatic conversion to
MinecraftUserobjects in player-related APIs. - Full access to SFTP credentials from API payloads without implementing SFTP transport.
- Simple websocket-based access to console chat.
Installation
pip install minestrator-api
Chat access requires an optional dependency:
pip install minestrator-api[realtime]
Quick Start
from minestrator_api import Client
client = Client(api_key="YOUR_API_KEY", user_id=<USER_ID>)
server = client.server(<SERVER_ID>)
print(server.server_name)
print(server.status)
print(server.version)
for player in server.get_online_players():
print(player.username, player.uuid)
Chat Access
from minestrator_api import Client
client = Client(api_key="YOUR_API_KEY", user_id=<USER_ID>)
server = client.server(<SERVER_ID>)
for line in server.iter_chat_messages(send_logs=True):
print(f"<{line.author.username}> {line.content}")
Main Endpoints Covered
GET /server/{id}GET /server/{id}/liveGET /server/{id}/propertiesGET /server/{id}/files/list/{path}GET /server/{id}/files/content/{path}GET|POST /server/{id}/files/existsGET /server/{id}/pluginsGET /server/{id}/modsGET /server/{id}/stats/{start}/{end}PUT /server/{id}/commandGET /user/{id}/serversGET /user/{id}/servers/websocket
SFTP Credentials
The library intentionally does not implement SFTP transport. It only exposes credentials so users can connect with their own SFTP tooling.
creds = server.get_sftp_credentials()
if creds:
print(creds.endpoint)
Project Layout
src/minestrator_api/
__init__.py
_http.py
_utils.py
client.py
errors.py
models.py
server.py
AI were used in this project
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minestrator_api-0.1.3.tar.gz.
File metadata
- Download URL: minestrator_api-0.1.3.tar.gz
- Upload date:
- Size: 16.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f74cbf19d08861453b60d1e873129a02f2a662c55114bededfd1d60dcc2f996a
|
|
| MD5 |
912cd4ff1343b9a872cc2f31f8e2fee3
|
|
| BLAKE2b-256 |
79ac630c247bcb7bdd7053bc0062f72bc847762cbeaec9ed9157d1e1d63fd0b3
|
File details
Details for the file minestrator_api-0.1.3-py3-none-any.whl.
File metadata
- Download URL: minestrator_api-0.1.3-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7345f694da35e0e0e9863ee8199b6f19864470fdb90c57ffbb2c52a76fdb188a
|
|
| MD5 |
2dc2868da913c28d74458a54d9cbc4f4
|
|
| BLAKE2b-256 |
36f485f3993a22caf0078f40aa20cb7a934b1d080d55cca03354c0974e3b9d81
|