This repository hosts the code of the TruckersMP API Wrapper, written in Python.
- Most of the API endpoints available are able to be called via a function
This module is compatible with Python v3+
You can install this module via github or PyPI:
$ pip install git+https://github.com/supraaxdd/TruckersMP.py.git
$ pip install TruckersMP.py
from truckersmp import TruckersMP
truckersmp = TruckersMP()
# Returns the statuses of all servers.
print(truckersmp.get_servers())
# Fetches the information about the desired player.
print(truckersmp.get_player("id of player")) # Can be a string or integer
# Fetches the information about the desired VTC.
print(truckersmp.get_vtc("id of vtc")) # Can be a string or integer
# Fetches any bans on the desired player's account.
print(truckersmp.get_bans("id of player")) # Can be a string or integer
Available Methods:
get_player(playerID) # Fetches Player data
get_bans(playerID) # Fetches any bans for a given player
get_servers() # Fetches information about servers
get_in_game_time() # Fetches current in-game time which is synced across all servers
get_version() # Fetches supported game version
get_events() # Fetches events from the index page in JSON format
get_event(eventID) # Fetches specific event using given eventID
get_vtc_index() # Fetches VTCs from the index page in JSON format
get_vtc(vtcID) # Fetches specific VTC data. Returns information such as roles, members, general information etc.
get_vtc_member(vtcID, memberID) # Fetches a given member from the given VTC
get_vtc_event(vtcID, eventID) # Fetches a given event from the given VTC
get_rules() # Fetches all the rules in JSON format
If you need help with anything, you should preferably contact Supra#6561 or Blinkzy#3819 on discord. If that is not possible, feel free to open a new issue. Note that if the issue is invalid, it may be closed.
- Feel free to Fork & Clone the repository and make sure that it is on the master branch as that branch is the most up to date one and the most stable.
- Make the changes that you want to propose and code whatever you want!
- Make sure that everything is good shape and then feel free to create a Pull Request which will be reviewed.
Main Contributors: supraaxdd & ItzBlinkzy