Skip to main content

An async library/wrapper for interacting with remote consoles on Minecraft Java Edition servers

Project description

Aio-MC-RCON Code Quality PYPI Version PYPI Downloads Views

An async RCON client/wrapper written in Python for Minecraft Java Edition servers

Installation

Via pip: python3 -m pip install -U aio-mc-rcon or pip3 install -U aio-mc-rcon

Example Usage

import aiomcrcon
import asyncio

async def main():
  client = aiomcrcon.Client('1.2.3.4:25575', 'super-secret-password')

  await client.setup()

  output = await client.send_cmd('list')
  print(output)

  await client.close()

asyncio.run(main())

Documentation

class aiomcrcon.Client(host: str, auth: str)

  • Note: It is highly recommended to call the close() coroutine on the client when the client is done being used
  • Arguments:
    • host: str The hostname/ip of the server to connect to, if no port is specified, the default port (25575) is used.
    • auth: str The authentication/password for the rcon server (This is rcon.password in the server.properties file)
    • timeout: int How long to wait in seconds for a connection to the server
  • Coroutines:
    • send_cmd(cmd: str) - where cmd is the command to be sent to the server
    • close() - close the connection to the Minecraft server

class aiomcrcon.PacketTypes()

  • Attributes:
    • LOGIN: int - The packet id / type for a LOGIN packet
    • COMMAND: int - The packet id / type for a COMMAND packet
    • COMMAND_RESPONSE: int - The packet id / type for a COMMAND_RESPONSE packet
    • INVALID_AUTH: int - The packet id / type for an INVALID_AUTH packet

exception aiomcrcon.ConnectionFailedError - Raised when the connection to the server failed

exception aiomcrcon.InvalidAuthError - Raised when the provided password/authentication is invalid

exception aiomcrcon.InvalidDataReceivedError - Raised when the data the server sends back is invalid

exception aiomcrcon.ClientClosedError - Raised when a function is called after the client has closed its connection to the server

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

aio-mc-rcon-2.0.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

aio_mc_rcon-2.0.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file aio-mc-rcon-2.0.2.tar.gz.

File metadata

  • Download URL: aio-mc-rcon-2.0.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.6

File hashes

Hashes for aio-mc-rcon-2.0.2.tar.gz
Algorithm Hash digest
SHA256 cef6357f8141d9899b0e7ce06d4e372beb5608b37c536b403b9065cef6f436c6
MD5 dd888782c3940e0884766f6e0e446f9c
BLAKE2b-256 f1fd7977d127f1d8f7674d78719594685f73b63c393d3ed9876c9edf908ea8b7

See more details on using hashes here.

File details

Details for the file aio_mc_rcon-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: aio_mc_rcon-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.6

File hashes

Hashes for aio_mc_rcon-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0ddd7923ff94c3421a7f668308aa32f5ac8cbebf41341c93d5eb4a37d34c1b04
MD5 e3f948355447b0d4eb2ead7d3a42dc13
BLAKE2b-256 9130eb9816d4c1fd9754f4fc74aca1f164ca8389931caf8e7b79c8f13cec6991

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