Skip to main content

Python wrapper for the Oxford Response API

Project description

oxrpy

A Python wrapper for the Oxford RP API.

Installation

Install from PyPI:

pip install oxrpy Or from source:

pip install -r requirements.txt

Usage

from oxrpy import OxfordAPI

Initialize with your server ID and key

api = OxfordAPI(server_id="your_server_id", server_key="your_server_key")

Get server information

server_info = api.get_server() print(server_info)

Get current players

players = api.get_players() print(players)

Get queue

queue = api.get_queue() print(queue)

Get bans

bans = api.get_bans() print(bans)

Features

  • Automatic rate limiting (5 requests per second max)
  • Comprehensive error handling with custom exceptions
  • Request timeouts
  • Logging support
  • Input validation

API Endpoints

get_server(): Returns general server information. Example response:

{
  "Name": "Oxford Roleplay",
  "StyledName": "Oxford RP",
  "Description": "UK emergency roleplay server",
  "Tags": ["UK", "RP"],
  "ThemeColour": "#ffffff",
  "OwnerId": 123456789,
  "CurrentPlayers": 18,
  "MaxPlayers": 32,
  "JoinCode": "OXFD-ABCD",
  "CreatedAt": 1700000000,
  "Packages": []
}

get_players(): Returns list of current players. Example response:

[
  {
    "Username": "PlayerOne",
    "DisplayName": "PlayerOne",
    "UserId": 12345,
    "Team": "Civilian",
    "WantedLevel": 0,
    "Permission": "Admin",
    "Callsign": "A12",
    "Location": "Near Oxford City Centre"
  }
]

get_queue(): Returns the reserved server queue. Example response:

{
  "total": 2,
  "users": [12345, 67890]
}

get_bans(): Returns active bans. Example response:

[
  {
    "UserId": 12345,
    "Username": "BannedUser",
    "Reason": "Fail RP",
    "BannedBy": "API",
    "BannedById": 2,
    "Expiry": 1701000000
  }
]

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

oxrpy-0.6.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

oxrpy-0.6.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file oxrpy-0.6.0.tar.gz.

File metadata

  • Download URL: oxrpy-0.6.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for oxrpy-0.6.0.tar.gz
Algorithm Hash digest
SHA256 c5aa6875794250acdbcc3a64e133198804c78d3a009bb4fc2872a5e80dded21e
MD5 de46f9b29db7658d15a0b47e39416ffe
BLAKE2b-256 386b6395be5671568e75c9d814e1e5de83322670ab3899cd3d5e9329c683fcbc

See more details on using hashes here.

File details

Details for the file oxrpy-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: oxrpy-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for oxrpy-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6351d6f3601b2e0666f0784fc7de6ed7f910a1b7e1b94c8ea1df66d500507d59
MD5 2154b52d78c981d4c755e9ab3195a43a
BLAKE2b-256 f33848ad80cffa4f65d1eab8de9a1d8773b3bc0c78381dbf25eb73a89448c016

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