Metadata-Version: 2.4
Name: oxrpy
Version: 0.8.0
Summary: Python wrapper for the Oxford Response API
Project-URL: Homepage, https://github.com/BLK-TTAUDI/OXRPY
Project-URL: Repository, https://github.com/BLK-TTAUDI/OXRPY
Classifier: Programming Language :: Python :: 3
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Dynamic: license-file

# oxrpy
A Python wrapper for the Oxford Response API.

## Installation

Install from PyPI:
```
pip install oxrpy
```

Or from source:
```
pip install -r requirements.txt
```

## Usage
```python
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:
```json
{
  "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:
```json
[
  {
    "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:
```json
{
  "total": 2,
  "users": [12345, 67890]
}
```

get_bans(): Returns active bans.
Example response:
```json
[
  {
    "UserId": 12345,
    "Username": "BannedUser",
    "Reason": "Fail RP",
    "BannedBy": "API",
    "BannedById": 2,
    "Expiry": 1701000000
  }
]
```

get_killlogs(): Returns recent kill logs (maximum 100 entries).
Example response:
```json
[
  {
    "Timestamp": 1700000100,
    "KillerUserId": 123,
    "KillerUsername": "OfficerA",
    "VictimUserId": 456,
    "VictimUsername": "SuspectB",
    "Distance": 42,
    "Weapon": "Taser"
  }
]
```

get_commandlogs(): Returns recent command execution logs.
Example response:
```json
[
  {
    "Timestamp": 1700000200,
    "UserId": 789,
    "Username": "AdminUser",
    "Command": "kick",
    "Args": ["PlayerOne"]
  }
]
```

get_modcalls(): Returns recent moderator call requests.
Example response:
```json
[
  {
    "Timestamp": 1700000300,
    "CallerUserId": 123,
    "CallerUsername": "PlayerOne",
    "CallerDisplayName": "Player One",
    "CaseId": "CASE-001",
    "Responders": [
      {
        "UserId": 789,
        "Username": "ModeratorA"
      }
    ]
  }
]
```

get_vehicles(): Returns vehicles currently spawned in the server.
Example response:
```json
[
  {
    "OwnerUserId": 123,
    "OwnerUsername": "PlayerOne",
    "Registration": "OX12 ABC",
    "Model": "Volvo XC90",
    "Electric": false,
    "ELS": true,
    "ELS_Style": "UK"
  }
]
```

execute_command(command): Executes a permitted command on the server.
Example response:
```json
{
  "message": "Command sent successfully"
}
```



