Skip to main content

Renault API

Project description

PyPI Python Version License

Read the documentation at https://renault-api.readthedocs.io/ Tests Codecov

pre-commit Black

Features

This Python package manages the communication with the private Renault API used by the official MyRenault application.

The client is able to read various vehicle attributes, such as:

  • mileage

  • GPS location

  • fuel autonomy (for fuel vehicles)

  • battery autonomy (for electric vehicles)

  • contracts associated to the vehicle (warranty and connected services)

For some vehicles, it is also possible to manage:

  • hvac/pre-conditionning of the vehicle

  • charge schedule

This package has been developed to be used with Home-Assistant, but it can be used in other contexts

Requirements

  • Python (>= 3.7.1)

API Usage

You can install Renault API via pip from PyPI:

$ pip install renault-api
import aiohttp
import asyncio

from renault_api.renault_client import RenaultClient

async def main():
   async with aiohttp.ClientSession() as websession:
      client = RenaultClient(websession=websession, locale="fr_FR")
      await client.session.login('email', 'password')
      print(f"Accounts: {await client.get_person()}") # List available accounts, make a note of kamereon account id

      account_id = "Your Kamereon account id"
      account = await client.get_api_account(account_id)
      print(f"Vehicles: {await account.get_vehicles()}") # List available vehicles, make a note of vehicle VIN

      vin = "Your vehicle VIN"
      vehicle = await account.get_api_vehicle(vin)
      print(f"Cockpit information: {await vehicle.get_cockpit()}")
      print(f"Battery status information: {await vehicle.get_battery_status()}")

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

CLI Usage

The renault-api is also available through a CLI, which requires additional dependencies. For the added dependencies, you can install Renault API via pip from PyPI:

$ pip install renault-api[cli]

Once installed, the following command prompts for credentials and settings, displays basic vehicle status information, and generates traces:

$ renault-api --log status
  • Credentials will automatically be stored in the user home directory (~/.credentials/renault-api.json)

  • Logs will automatically be generated in logs subfolder

Please see the Command-line Reference for full details.

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, Renault API is free and open source software.

Disclaimer

This project is not affiliated with, endorsed by, or connected to Renault. I accept no responsibility for any consequences, intended or accidental, as a as a result of interacting with Renault’s API using this project.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from @cjolowicz’s Hypermodern Python Cookiecutter template. This project was heavily based on @jamesremuscat’s PyZE python client for the Renault ZE API.

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

renault-api-0.1.10.tar.gz (35.5 kB view details)

Uploaded Source

Built Distribution

renault_api-0.1.10-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

Details for the file renault-api-0.1.10.tar.gz.

File metadata

  • Download URL: renault-api-0.1.10.tar.gz
  • Upload date:
  • Size: 35.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for renault-api-0.1.10.tar.gz
Algorithm Hash digest
SHA256 edf2acfd2d8e59c034a62eb4eea9b1891c4172c42c4d05069c7dc20c62144158
MD5 6ea6f0ec54d8ed7e32f03706773a3d35
BLAKE2b-256 39596dc54784a28897b6da65009fe7a135911bc8bbf743543b4a43db723d9783

See more details on using hashes here.

Provenance

File details

Details for the file renault_api-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: renault_api-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 46.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for renault_api-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 a52245914c0d0af48126d914cef17ca156fd0fe6a316a343e0f13d3cdb500705
MD5 a85b27088dd873c3a4e158102924a3c1
BLAKE2b-256 d8b4ce4504184b9f01cb56b31a0111cd9470867d915c096b984fd8ffab99f303

See more details on using hashes here.

Provenance

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