Skip to main content

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 MinecraftUser objects 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}/live
  • GET /server/{id}/properties
  • GET /server/{id}/files/list/{path}
  • GET /server/{id}/files/content/{path}
  • GET|POST /server/{id}/files/exists
  • GET /server/{id}/plugins
  • GET /server/{id}/mods
  • GET /server/{id}/stats/{start}/{end}
  • PUT /server/{id}/command
  • GET /user/{id}/servers
  • GET /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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minestrator_api-0.1.3.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

minestrator_api-0.1.3-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

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

Hashes for minestrator_api-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f74cbf19d08861453b60d1e873129a02f2a662c55114bededfd1d60dcc2f996a
MD5 912cd4ff1343b9a872cc2f31f8e2fee3
BLAKE2b-256 79ac630c247bcb7bdd7053bc0062f72bc847762cbeaec9ed9157d1e1d63fd0b3

See more details on using hashes here.

File details

Details for the file minestrator_api-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for minestrator_api-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7345f694da35e0e0e9863ee8199b6f19864470fdb90c57ffbb2c52a76fdb188a
MD5 2dc2868da913c28d74458a54d9cbc4f4
BLAKE2b-256 36f485f3993a22caf0078f40aa20cb7a934b1d080d55cca03354c0974e3b9d81

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