Skip to main content

factorio-rcon-py

A simple Factorio RCON client

Install

Without async support pip install factorio-rcon-py

With async support pip install factorio-rcon-py[async]

Async support is available as soon as the required dependency (anyio) is installed, so pip install factorio-rcon-py anyio is mostly equivalent, but not recommended due to dependency versioning.

Python 3.8+ is required.

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 class/method.

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

Available methods 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_packet - Receives a packet from the RCON server.
  • send_command - Sends a single command to the RCON server.
  • send_commands - Sends multiple commands to the RCON server.

Note that both the sync/async clients can be used as sync/async context managers respectively.

The methods 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.
  • De Sa Léo for contributing context manager support and typing improvements.

License

LGPLv2.1

Release files for factorio-rcon-py 2.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for factorio-rcon-py 2.1.3
File Size Uploaded
factorio_rcon_py-2.1.3.tar.gz 17.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for factorio-rcon-py 2.1.3
File Interpreter ABI Platform
factorio_rcon_py-2.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 34.7 kB

Release files / factorio_rcon_py-2.1.3.tar.gz

Download URL factorio_rcon_py-2.1.3.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
84bfc42d2adfcd01660bd403652c6453f6be2b474817e214e75206f02b1512c3
BLAKE2b-256 checksum
How to use checksums
2324ddb08445a3a00c4b106b81ee2b3b59061cd29ea8f4968ec33954adf1c46a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.3

Release files / factorio_rcon_py-2.1.3-py3-none-any.whl

Download URL factorio_rcon_py-2.1.3-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad2e73f5442cd1df235f435bf1079dd73eb62d1856d7526e4a0b6d4400b6cbb0
BLAKE2b-256 checksum
How to use checksums
f5d6d100cca0fddea8241d44205e17c52b3b9b71ca4accf6db3fbe8262e27cc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.3

Release history Release notifications | RSS feed

This release

2.1.3 This release

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.1

2 release files

1.2.0

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1.0

1 release file

1.0.2

2 release files

1.0.1

2 release files

1.0.0

3 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page