Python 3 package to communicate with Toyota Connected Europe Services. This is an unofficial package and Toyota can change their API at any point without warning.
This package can be installed through pip.
pip install pytoyodahttps://pytoyoda.github.io/pytoyoda/pytoyoda.html
For a quick start on how to use the package take a look at the simple_client_example.py file contained in the report. You can also use and execute this file directly by using the following commands:
python -m venv pytoyoda
source pytoyoda/bin/activate
python -m pip install "pytoyoda@git+https://github.com/pytoyoda/pytoyoda@main"
curl -LO https://raw.githubusercontent.com/pytoyoda/pytoyoda/main/sandbox/simple_client_example.py
# Create a credentials.json file with {"username":"your@mail.tld","password":"yourpassword"}
python simple_client_example.pyPlease note that the simple_client_example.py file is only to be regarded as a playground and is intended to provide an initial insight into the possibilities. It is not an officially supported interface of the pytoyoda API!
For an overview of the current official interfaces, please take a look at our documentation.
- Statistical endpoint will return
Noneif no trip have been performed in the requested timeframe. This problem will often happen at the start of each week, month or year. Also daily stats will of course also be unavailable if no trip have been performed. - Currently, it is only possible to get various vehicle information. Functions for controlling and setting vehicle properties have not yet been implemented.
GET /v1/global/remote/status(used byVehicle.lock_status) returns429 APIGW-403 "Unauthorized"frequently, often without obvious correlation to call rate. Empirically, issuingPOST /v1/global/remote/refresh-statusfirst - the same wake the Toyota Android app uses - improves the success rate of subsequent GETs and gives fresheroccurrence_datepayloads, suggesting at least some of the 429s come from a stale or empty server-side cache rather than rate-limiting. Other 429s appear to be unrelated to cache state and happen seemingly at random; pytoyoda retries those with exponential backoff. CallVehicle.refresh_status()first, then pollVehicle.update(only=["status"])untillock_status.last_updatedadvances.
This python module uses poetry (>= 2.0.0) and pre-commit.
To start contributing, fork this repository and run poetry install. Then create a new branch. Before making a PR, please run pre-commit poetry run pre-commit run --all-files and make sure that all tests passes locally first by running pytest tests/.
This is a friendly community fork of the original project by @DurgNomis-drol, to ease up on maintenance and the bus factor for this project.
Special thanks go @DurgNomis-drol for starting this project! A huge thanks go to @calmjm for making tojota.