Skip to main content

A Python wrapper for the ERLC PRC API

Project description

pyerlc-v2

pyerlc-v2 is the second major version of pyerlc. If you are looking for Version 1, it is deprecated and no longer maintained.

pyerlc is a lightweight Python SDK for the Emergency Response: Liberty County (ER:LC) PRC API v2.

It allows developers to interact with live server data, player locations, staff information, logs, vehicles, and execute in-game commands through a simple and modern Python interface.


🚀 Features

  • 📊 Live server status monitoring
  • 👥 Real-time player tracking with location data
  • 📍 Postal + street-level positioning system
  • 👮 Staff data (Admins / Mods / Helpers)
  • 🔫 Kill, join, command, and moderation logs
  • 🚓 Vehicle tracking (plates, colours, ownership)
  • 📞 Emergency call monitoring
  • 🧠 Remote in-game command execution
  • ⚡ Single-request full server data fetch (v2 feature)

📦 Installation

** Ensure pyerlc v1 is removed **

pip install pyerlc-v2

⚠️ Requirements

  • Python 3.12+
  • Valid PRC Server Key from ER:LC server settings

🧑‍💻 Quick Start

from pyerlc_v2 import PRCClientV2

client = PRCClientV2(server_key="YOUR_SERVER_KEY")

# Server status
status = client.get_server_status()
print(status)

# Get all players with location data
players = client.get_players()
print(players)

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

📍 Player Location System (v2)

Each player now includes live world positioning data:

{
    "player": "JohnDoe:123",
    "team": "Police",
    "callsign": "5D-550",

    "x": 1084.965,
    "z": 2302.28,

    "postal": "218",
    "street": "Park Street",
    "building": "2083",

    "formatted_location": "2083 Park Street (Postal 218)"
}

🗺️ Map System

PRC v2 uses an X/Z coordinate system:

  • X/Z → world position
  • Postal Code → regional identifier
  • Street Name → road-level detail

Official PRC Maps


📡 API Methods

🏛️ Server Data

client.get_server_status()
client.get_players()
client.get_staff()
client.get_queue()
client.get_all_data()

📊 Logs

client.get_join_logs()
client.get_kill_logs()
client.get_command_logs()
client.get_mod_calls()
client.get_emergency_calls()

🚗 Vehicles

client.get_vehicles()

Example:

{
    "name": "Redline Fire Engine",
    "owner": "Shawnyg",
    "plate": "ABC-123",
    "texture": "Livery Name",
    "color_hex": "#ff4444",
    "color_name": "Super Red"
}

🧠 Commands

client.run_command(":h Hello world!")

Response example:

{
    "success": true,
    "status_code": 200,
    "data": {
        "message": "Success"
    }
}

⚡ Full Server Fetch (v2 Feature)

Fetch everything in a single request:

data = client.get_all_data()

Includes:

  • Players
  • Staff
  • Logs
  • Vehicles
  • Emergency calls
  • Queue

📞 Emergency Calls

{
    "team": "Police",
    "caller": 168691872,
    "players": [],
    "position": [-654.6, 666.5],
    "started_at": 1774216563,
    "call_number": 400,
    "description": "stg",
    "position_descriptor": "sdfsdfsdf"
}

👮 Staff Structure

{
    "Admins": {
        "54249787": "PlayerName"
    },
    "Mods": {},
    "Helpers": {}
}

🧠 Error Handling

All responses follow this structure:

{
    "success": true,
    "status_code": 200,
    "data": {},
    "error_message": "Optional error message",
    "error_code": 0
}

❌ Common Errors

Code Meaning
2000 No server key
2002 Invalid server key
3001 Invalid command
3002 Server offline
4001 Rate limited
4002 Restricted command

🧪 Example Use Cases

📍 Track a player by name

player = client.get_player_by_name("JohnDoe")
print(player["formatted_location"])

📮 Find players in a postal

units = client.get_players_by_postal("218")
print(units)

🚓 Dispatch-style monitoring

data = client.get_all_data()

for p in data["Players"]:
    print(p["player"], p["formatted_location"])

📦 Project Info


📜 License

MIT License


⚒️ Built with ❤️ by epell Development🦘

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

pyerlc_v2-2.0.4.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

pyerlc_v2-2.0.4-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file pyerlc_v2-2.0.4.tar.gz.

File metadata

  • Download URL: pyerlc_v2-2.0.4.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for pyerlc_v2-2.0.4.tar.gz
Algorithm Hash digest
SHA256 d9b751e4ba0bd1110e8d0d577d7c08cab425475d5e561e2869ff987e62c94da6
MD5 d911a24ffe7af56c5afa6ba608aa007a
BLAKE2b-256 a7521c7a843fc021a40c70355934dc522a350bdab990d9561ed26128c70b2085

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyerlc_v2-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 10d74ac6f3883e3bcb6345cccae6dad6d7e9dfac674cc3ccb930615c705738bb
MD5 157e703782e0c8e986f1d1b466911f58
BLAKE2b-256 eec4f8732ca5210204c856edd8f5a5e04a694b894187bf4e95eb00907ddf2399

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