Skip to main content

A Python wrapper for the ERLC PRC API

Project description

pyerlc

pyerlc is a lightweight Python wrapper for the Emergency Response: Liberty County (ERLC) Police Roleplay Community (PRC) API. It allows you to interact programmatically with your PRC server, providing access to live server data and admin controls.

Features

  • ✅ Get server status
  • 👥 Fetch player lists and join logs
  • 🔫 Retrieve kill and command logs
  • 🚓 View active vehicles and bans
  • 🛑 See moderation calls and queue status
  • 🧠 Run in-game commands remotely

Installation

pip install pyerlc

Requires: Python 3.12 or higher

Usage

from pyerlc import PRCClient

client = PRCClient(server_key="your_server_key", global_api_key="your_global_api_key")

# Get server status
status = client.get_server_status()
print(status)

# Run an in-game command
response = client.run_command("announce Hello from pyerlc!")
print(response)

Please only use a 'global_api_key' if you have been provided with one.

API Methods

Method Description
get_server_status() Returns general info about the server
get_players() Lists all players currently online
get_join_logs() Returns recent player join logs
get_kill_logs() Returns recent player kill logs
get_command_logs() Lists executed commands
get_mod_calls() Shows active mod calls
get_queue() Lists users in the server queue
get_bans() Retrieves the ban list
get_vehicles() Lists vehicles currently spawned
run_command(command: str) Runs a command on the server

Error Handling

All methods return a dictionary with the following structure:

{
    "success": True or False,
    "status_code": 200,
    "data": {...} or None,
    "error_message": "Optional error message",
    "error_code": 0  # only present if returned by the API
}

Contributing

Contributions are welcome! Submit a PR or open an issue on GitHub.

Links

License

This project is licensed under the MIT License.


Built and maintained with 💙 by epell Development, Product of Australia🦘

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pyerlc_v2-2.0.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file pyerlc_v2-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyerlc_v2-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for pyerlc_v2-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b552d0b4fd52f53adcd80d50bde8bd801dc4092d6e4bcd6ac3e70d71211fae15
MD5 f7fb9fa73809a0932924b9b458bffd50
BLAKE2b-256 bdfcac41a735031aa779c6e90b31c39c3bb50bbf3df0d4d5fe977513c7539d74

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