Skip to main content

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 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)

📦 Project Info


📜 License

MIT License


⚒️ Built with ❤️ by epell Development🦘

Metadata

Release files for pyerlc-v2 2.1.1

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

Source distribution (sdist)

Source distribution for pyerlc-v2 2.1.1
File Size Uploaded Provenance Actions
pyerlc_v2-2.1.1.tar.gz 10.6 kB Without provenance Details for pyerlc_v2-2.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyerlc-v2 2.1.1
File Interpreter ABI Platform Actions
pyerlc_v2-2.1.1-py3-none-any.whl Python 3 none any Details for pyerlc_v2-2.1.1-py3-none-any.whl

Total release size: 20.7 kB

Release files / pyerlc_v2-2.1.1.tar.gz

Download URL pyerlc_v2-2.1.1.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
07b8a6f8543d9902213a01e88284b77cc496f6ae79bc64710ec4c7ccc9a39c48
BLAKE2b-256 checksum
How to use checksums
c17a72ecdfae4b8362350e4e6bbc8eae2d768ae4a8152a3c0d4ad2e196abb25a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release files / pyerlc_v2-2.1.1-py3-none-any.whl

Download URL pyerlc_v2-2.1.1-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c0705bacbdce1dc5b464e85f517782692ea8f6ffe38c9698d4fa0e4854c01a0
BLAKE2b-256 checksum
How to use checksums
c104e94519eef57c376339b836907ba0808bd54a8413aca021ec9d7252f8da68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Security for pyerlc-v2 2.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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