Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A simple factorio RCON client

Project description

factorio-rcon-py

A simple factorio RCON client

Install

pip3 install factorio-rcon-py

Usage

Example:

import factorio_rcon

client = factorio_rcon.RCONClient("127.0.0.1", 12345, "mypassword")
response = client.send_command("/help")

All documentation is in the docstrings of each function/class. Currently, there is no docs website or similar but one is planned.

Asynchronous usage of this module is possible thanks to anyio. This means that you can use the async client with asyncio, curio and trio. Use the AsyncRCONClient class. More details are in its docstring.

Available functions in both classes are (see docstrings for more info):

  • connect - Connects to the RCON server.
  • close - Closes the connection to the RCON server.
  • send_packet - Sends a packet to the RCON server.
  • receive_packets - Receives a variable number of packets from the RCON server.
  • send_command - Sends a single command to the RCON server.
  • send_commands - Sends multiple commands to the RCON server.

The functions for sending/receiving packets are available in case you want to write your own packet handlers, but in most cases you will never need to touch these and can use send_command(s).

Mentions

Thanks to Truman Kilen for the initial code / idea.

License

GPLV3

Project details


Download files

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

Files for factorio-rcon-py, version 1.2.1
Filename, size File type Python version Upload date Hashes
Filename, size factorio_rcon_py-1.2.1-py3-none-any.whl (18.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size factorio-rcon-py-1.2.1.tar.gz (5.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page