%global _empty_manifest_terminate_build 0 Name: python-mytoyota Version: 0.9.1 Release: 1 Summary: Python client for Toyota Connected Services. License: MIT URL: https://github.com/DurgNomis-drol/mytoyota Source0: https://mirrors.nju.edu.cn/pypi/web/packages/68/5b/19b0f043869304f8efd89b68c2c5f17b3964fce204f6030309a009b5ea01/mytoyota-0.9.1.tar.gz BuildArch: noarch Requires: python3-langcodes Requires: python3-httpx Requires: python3-arrow Requires: python3-importlib-metadata %description [![GitHub Workflow Status][workflow-shield]][workflow] [![GitHub Release][releases-shield]][releases] [![GitHub Activity][commits-shield]][commits] # Toyota Connected Services Python module ### [!] **This is still in beta** ## Description Python 3 package to communicate with Toyota Connected Services. This is an unofficial package and Toyota can change their API at any point without warning. ## Installation This package can be installed through `pip`. ```text pip install mytoyota ``` ## Usage ```python import json import asyncio from mytoyota.client import MyT username = "jane@doe.com" password = "MyPassword" # Get supported regions, can be passed to the optional 'region' argument of MyT print(MyT.get_supported_regions()) client = MyT(username=username, password=password) async def get_information(): print("Logging in...") await client.login() print("Retrieving cars...") # Returns cars registered to your account + information about each car. cars = await client.get_vehicles() for car in cars: # Returns live data from car/last time you used it as an object. vehicle = await client.get_vehicle_status(car) # You can either get them all async (Recommended) or sync (Look further down). data = await asyncio.gather( *[ client.get_driving_statistics(vehicle.vin, interval="day"), client.get_driving_statistics(vehicle.vin, interval="isoweek"), client.get_driving_statistics(vehicle.vin), client.get_driving_statistics(vehicle.vin, interval="year"), ] ) # You can access odometer data like this: mileage = vehicle.dashboard.odometer # Or retrieve the energy level (electric or gasoline) fuel = vehicle.dashboard.fuel_level battery = vehicle.dashboard.battery_level # Or Parking information: latitude = vehicle.parkinglocation.latitude # Daily stats daily_stats = await client.get_driving_statistics(vehicle.vin, interval="day") # ISO 8601 week stats iso_weekly_stats = await client.get_driving_statistics(vehicle.vin, interval="isoweek") # Monthly stats is returned by default monthly_stats = await client.get_driving_statistics(vehicle.vin) # Get year to date stats. yearly_stats = await client.get_driving_statistics(vehicle.vin, interval="year") loop = asyncio.get_event_loop() loop.run_until_complete(get_information()) loop.close() ``` ## Known issues - Statistical endpoint will return `None` if 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. ## Docs Coming soon... ## Contributing This python module uses poetry 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. ## Note As I [@DurgNomis-drol](https://github.com/DurgNomis-drol) am not a professional programmer. I will try to maintain it as best as I can. If someone is interested in helping with this, they are more the welcome to message me to be a collaborator on this project. ## Credits A huge thanks go to [@calmjm](https://github.com/calmjm) for making [tojota](https://github.com/calmjm/tojota). [releases-shield]: https://img.shields.io/github/release/DurgNomis-drol/mytoyota.svg?style=for-the-badge [releases]: https://github.com/DurgNomis-drol/mytoyota/releases [workflow-shield]: https://img.shields.io/github/workflow/status/DurgNomis-drol/mytoyota/Linting?style=for-the-badge [workflow]: https://github.com/DurgNomis-drol/mytoyota/actions [commits-shield]: https://img.shields.io/github/commit-activity/y/DurgNomis-drol/mytoyota.svg?style=for-the-badge [commits]: https://github.com/DurgNomis-drol/mytoyota/commits/master %package -n python3-mytoyota Summary: Python client for Toyota Connected Services. Provides: python-mytoyota BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-mytoyota [![GitHub Workflow Status][workflow-shield]][workflow] [![GitHub Release][releases-shield]][releases] [![GitHub Activity][commits-shield]][commits] # Toyota Connected Services Python module ### [!] **This is still in beta** ## Description Python 3 package to communicate with Toyota Connected Services. This is an unofficial package and Toyota can change their API at any point without warning. ## Installation This package can be installed through `pip`. ```text pip install mytoyota ``` ## Usage ```python import json import asyncio from mytoyota.client import MyT username = "jane@doe.com" password = "MyPassword" # Get supported regions, can be passed to the optional 'region' argument of MyT print(MyT.get_supported_regions()) client = MyT(username=username, password=password) async def get_information(): print("Logging in...") await client.login() print("Retrieving cars...") # Returns cars registered to your account + information about each car. cars = await client.get_vehicles() for car in cars: # Returns live data from car/last time you used it as an object. vehicle = await client.get_vehicle_status(car) # You can either get them all async (Recommended) or sync (Look further down). data = await asyncio.gather( *[ client.get_driving_statistics(vehicle.vin, interval="day"), client.get_driving_statistics(vehicle.vin, interval="isoweek"), client.get_driving_statistics(vehicle.vin), client.get_driving_statistics(vehicle.vin, interval="year"), ] ) # You can access odometer data like this: mileage = vehicle.dashboard.odometer # Or retrieve the energy level (electric or gasoline) fuel = vehicle.dashboard.fuel_level battery = vehicle.dashboard.battery_level # Or Parking information: latitude = vehicle.parkinglocation.latitude # Daily stats daily_stats = await client.get_driving_statistics(vehicle.vin, interval="day") # ISO 8601 week stats iso_weekly_stats = await client.get_driving_statistics(vehicle.vin, interval="isoweek") # Monthly stats is returned by default monthly_stats = await client.get_driving_statistics(vehicle.vin) # Get year to date stats. yearly_stats = await client.get_driving_statistics(vehicle.vin, interval="year") loop = asyncio.get_event_loop() loop.run_until_complete(get_information()) loop.close() ``` ## Known issues - Statistical endpoint will return `None` if 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. ## Docs Coming soon... ## Contributing This python module uses poetry 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. ## Note As I [@DurgNomis-drol](https://github.com/DurgNomis-drol) am not a professional programmer. I will try to maintain it as best as I can. If someone is interested in helping with this, they are more the welcome to message me to be a collaborator on this project. ## Credits A huge thanks go to [@calmjm](https://github.com/calmjm) for making [tojota](https://github.com/calmjm/tojota). [releases-shield]: https://img.shields.io/github/release/DurgNomis-drol/mytoyota.svg?style=for-the-badge [releases]: https://github.com/DurgNomis-drol/mytoyota/releases [workflow-shield]: https://img.shields.io/github/workflow/status/DurgNomis-drol/mytoyota/Linting?style=for-the-badge [workflow]: https://github.com/DurgNomis-drol/mytoyota/actions [commits-shield]: https://img.shields.io/github/commit-activity/y/DurgNomis-drol/mytoyota.svg?style=for-the-badge [commits]: https://github.com/DurgNomis-drol/mytoyota/commits/master %package help Summary: Development documents and examples for mytoyota Provides: python3-mytoyota-doc %description help [![GitHub Workflow Status][workflow-shield]][workflow] [![GitHub Release][releases-shield]][releases] [![GitHub Activity][commits-shield]][commits] # Toyota Connected Services Python module ### [!] **This is still in beta** ## Description Python 3 package to communicate with Toyota Connected Services. This is an unofficial package and Toyota can change their API at any point without warning. ## Installation This package can be installed through `pip`. ```text pip install mytoyota ``` ## Usage ```python import json import asyncio from mytoyota.client import MyT username = "jane@doe.com" password = "MyPassword" # Get supported regions, can be passed to the optional 'region' argument of MyT print(MyT.get_supported_regions()) client = MyT(username=username, password=password) async def get_information(): print("Logging in...") await client.login() print("Retrieving cars...") # Returns cars registered to your account + information about each car. cars = await client.get_vehicles() for car in cars: # Returns live data from car/last time you used it as an object. vehicle = await client.get_vehicle_status(car) # You can either get them all async (Recommended) or sync (Look further down). data = await asyncio.gather( *[ client.get_driving_statistics(vehicle.vin, interval="day"), client.get_driving_statistics(vehicle.vin, interval="isoweek"), client.get_driving_statistics(vehicle.vin), client.get_driving_statistics(vehicle.vin, interval="year"), ] ) # You can access odometer data like this: mileage = vehicle.dashboard.odometer # Or retrieve the energy level (electric or gasoline) fuel = vehicle.dashboard.fuel_level battery = vehicle.dashboard.battery_level # Or Parking information: latitude = vehicle.parkinglocation.latitude # Daily stats daily_stats = await client.get_driving_statistics(vehicle.vin, interval="day") # ISO 8601 week stats iso_weekly_stats = await client.get_driving_statistics(vehicle.vin, interval="isoweek") # Monthly stats is returned by default monthly_stats = await client.get_driving_statistics(vehicle.vin) # Get year to date stats. yearly_stats = await client.get_driving_statistics(vehicle.vin, interval="year") loop = asyncio.get_event_loop() loop.run_until_complete(get_information()) loop.close() ``` ## Known issues - Statistical endpoint will return `None` if 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. ## Docs Coming soon... ## Contributing This python module uses poetry 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. ## Note As I [@DurgNomis-drol](https://github.com/DurgNomis-drol) am not a professional programmer. I will try to maintain it as best as I can. If someone is interested in helping with this, they are more the welcome to message me to be a collaborator on this project. ## Credits A huge thanks go to [@calmjm](https://github.com/calmjm) for making [tojota](https://github.com/calmjm/tojota). [releases-shield]: https://img.shields.io/github/release/DurgNomis-drol/mytoyota.svg?style=for-the-badge [releases]: https://github.com/DurgNomis-drol/mytoyota/releases [workflow-shield]: https://img.shields.io/github/workflow/status/DurgNomis-drol/mytoyota/Linting?style=for-the-badge [workflow]: https://github.com/DurgNomis-drol/mytoyota/actions [commits-shield]: https://img.shields.io/github/commit-activity/y/DurgNomis-drol/mytoyota.svg?style=for-the-badge [commits]: https://github.com/DurgNomis-drol/mytoyota/commits/master %prep %autosetup -n mytoyota-0.9.1 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-mytoyota -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Wed May 10 2023 Python_Bot - 0.9.1-1 - Package Spec generated