Skip to main content

Simple API Wrapper for the TruckersMP API

Project description

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

  1. 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.
  2. Make the changes that you want to propose and code whatever you want!
  3. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

truckersmp.py-1.0.0.2-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file truckersmp.py-1.0.0.2-py3-none-any.whl.

File metadata

  • Download URL: truckersmp.py-1.0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for truckersmp.py-1.0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 afc842920285d20c570605a609c5b6df5ded1732efdea809dae6d29dfd3c999c
MD5 b1450d628dfcdde435d5de3fd492129e
BLAKE2b-256 bd1b6660d7a8ad3e1e9bbb6bc3cef92e70300e8844613d795ac99e29c63ab3b4

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