Skip to content
This repository was archived by the owner on Apr 24, 2026. It is now read-only.
SamNuttallPublic archive

About

An asynchronous Python API wrapper for the TruckersMP API.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

57 Commits

Folders and files

Repository files navigation

Async-TruckersMP

An asynchronous Python API wrapper for TruckersMP.

Warning

This project is no longer maintained and the repository has been archived.

There will be no further features or bug fixes. The code remains available for reference or forking.

Features

  • Rate limiting - Pre-emptive rate limiting so you'll never hit a 429.
  • Caching - Automatic caching of responses so you don't have to.
  • Configurable - Several configuration options on initialisation.
  • Documented - Full docs with examples included for reference.
  • Data models - API responses are parsed into objects (Python classes).

Usage

Install

Install via pip using either of these methods:

pip install async-truckersmp
pip install git+https://github.com/SamNuttall/Async-TruckersMP.git

Quickstart

Let's write a script to print all the server names.

from truckersmp import TruckersMP  # Import the library

loop = asyncio.get_event_loop()  # Get the asyncio event loop

async def main():
    truckersmp = TruckersMP()  # Initalise the TruckersMP class
    servers = await truckersmp.get_servers()  # Call the get_servers method
    for server in servers:  # Loop through each server
        print(server.name)  # Get the name of the server and print it

loop.run_until_complete(main())  # Run the main function

Resources & Support

Licence

Released under the MIT License.

About

An asynchronous Python API wrapper for the TruckersMP API.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages