Skip to main content

Trackmania.io API Wrapper

Project description

py-trackmania.io

Trackmania.io API Status

GitHub issues GitHub pull requests GitHub Repo stars GitHub forks

An Asyncio Friendly Trackmania API Wrapper for Python!

Important - Trackmania.io API for my own project?

See below on how to set your user_agent

Your User-Agent Must Have:

  1. Your Discord Username
  2. Your Project Name

Example: NottCurious#4351 | TMIndiaBot

" | via py-tmio" is automatically appended to your user_agent

How to set user_agent

from trackmania import Client

Client.user_agent = "NottCurious#4351 | TMIndiaBot"

How to set Redis Server host and port

from trackmania import Client

Client.redis_host = "127.0.0.1"
Client.redis_port = 6379

Docs

Docs can be found on readthedocs.org.

Installation

Note: Must have Python 3.10 or higher.

python3 -m pip install py-tmio # Linux

python -m pip install py-tmio # Windows

Caching

Caching is done using a redis server. The client defaults to 127.0.0.1:6379.

Caching is not required but is highly recommended.

Changelog

v0.1.0

15th March, 2022

  • First Beta Release of py-tmio
  • player_manager
    • get_player(player_id) command
    • search_player(username) command
    • to_account_id(username) command
    • to_username(account_id) command
    • top_matchmaking(group, page) command
    • top_trophies(page) command
  • ad_manager
    • get_ad(ad_id) command
  • totd_manager
    • latest_totd(leaderboard) command
    • totd(year, month, day, leaderboard) command

Examples

Latest TOTD

from trackmania.managers import totd_manager

# In Async Function
latest_totd = await totd_manager.latest_totd()

print(latest_totd.map_name)

Pull Requests and Issues

If you have any suggestions, bugs, fixes or enhancements, please open a Pull Request or Issue

Discord

Contact me on Discord if you have any questions, NottCurious#4351

License

MIT License

Project details


Download files

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

Source Distribution

py-tmio-0.1.0.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distribution

py_tmio-0.1.0-py3-none-any.whl (28.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page