Trackmania.io API Wrapper
Project description
Important - Trackmania.io API for my own project?
See below on how to set your user agent
Your User-Agent Must Have:
- Your Discord Username
- 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 Settings
from trackmania import Client
Client.REDIS_HOST = "127.0.0.1" # 127.0.0.1 is default
Client.REDIS_PORT = 6379 # 6379 is default
Client.REDIS_DB = 0 # 0 is default
Client.REDIS_PASSWORD = "yadayadayada" # Defaults to None. Don't need to change this if your redis server does not have a password.
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.2.0
23rd March, 2022
- Option to return raw data alongside the parsed data.
- All classes previously in
trackmania.structures
have been moved totrackmania
. - Update and fix lots of the problems I made.
v0.1.0
15th March, 2022
- First Beta Release of py-tmio
player_manager
get_player(player_id)
commandsearch_player(username)
commandto_account_id(username)
commandto_username(account_id)
commandtop_matchmaking(group, page)
commandtop_trophies(page)
command
ad_manager
get_ad(ad_id)
command
totd_manager
latest_totd(leaderboard)
commandtotd(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
Project details
Release history Release notifications | RSS feed
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.2.1.tar.gz
(17.0 kB
view hashes)
Built Distribution
py_tmio-0.2.1-py3-none-any.whl
(23.3 kB
view hashes)