TruckersMP.py
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
Table of contents
Installation and setup
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
Usage
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
Support
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.
Contributing
- 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.
Acknowledgements
Main Contributors: supraaxdd & ItzBlinkzy
Release files for truckersmp.py 1.0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| truckersmp.py-1.0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / truckersmp.py-1.0.0.2-py3-none-any.whl
| Download URL | truckersmp.py-1.0.0.2-py3-none-any.whl |
|---|---|
| Size | 16.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
afc842920285d20c570605a609c5b6df5ded1732efdea809dae6d29dfd3c999c
|
|
BLAKE2b-256 checksum How to use checksums |
bd1b6660d7a8ad3e1e9bbb6bc3cef92e70300e8844613d795ac99e29c63ab3b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2
|