Renault API
===========
|PyPI| |Python Version| |License|
|Read the Docs| |Tests| |Codecov|
|pre-commit| |Ruff|
.. |PyPI| image:: https://img.shields.io/pypi/v/renault-api.svg
:target: https://pypi.org/project/renault-api/
:alt: PyPI
.. |Python Version| image:: https://img.shields.io/pypi/pyversions/renault-api
:target: https://pypi.org/project/renault-api
:alt: Python Version
.. |License| image:: https://img.shields.io/pypi/l/renault-api
:target: https://opensource.org/licenses/MIT
:alt: License
.. |Read the Docs| image:: https://img.shields.io/readthedocs/renault-api/latest.svg?label=Read%20the%20Docs
:target: https://renault-api.readthedocs.io/
:alt: Read the documentation at https://renault-api.readthedocs.io/
.. |Tests| image:: https://github.com/hacf-fr/renault-api/workflows/Tests/badge.svg
:target: https://github.com/hacf-fr/renault-api/actions?workflow=Tests
:alt: Tests
.. |Codecov| image:: https://codecov.io/gh/hacf-fr/renault-api/branch/main/graph/badge.svg
:target: https://codecov.io/gh/hacf-fr/renault-api
:alt: Codecov
.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
:target: https://github.com/pre-commit/pre-commit
:alt: pre-commit
.. |Ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
:target: https://github.com/astral-sh/ruff
:alt: Ruff
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.8)
API Usage
---------
You can install *Renault API* via pip_ from PyPI_:
.. code:: console
$ pip install renault-api
.. code:: python
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_:
.. code:: console
$ pip install renault-api[cli]
Once installed, the following command prompts for credentials and settings, displays basic vehicle status information, and generates traces:
.. code:: console
$ 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 <Usage_>`_ 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.
.. _@cjolowicz: https://github.com/cjolowicz
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _@jamesremuscat: https://github.com/jamesremuscat
.. _PyZE: https://github.com/jamesremuscat/pyze
.. _MIT: http://opensource.org/licenses/MIT
.. _PyPI: https://pypi.org/
.. _Hypermodern Python Cookiecutter: https://github.com/cjolowicz/cookiecutter-hypermodern-python
.. _file an issue: https://github.com/hacf-fr/renault-api/issues
.. _pip: https://pip.pypa.io/
.. github-only
.. _Contributor Guide: CONTRIBUTING.rst
.. _Usage: https://renault-api.readthedocs.io/en/latest/usage.html
Raw data
{
"_id": null,
"home_page": "https://github.com/hacf-fr/renault-api",
"name": "renault-api",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "epenet",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/6b/da/f3b1ae0099a79b31b38ea59de9870dc979d2b0941f221fd5c28c2025f17f/renault_api-0.2.8.tar.gz",
"platform": null,
"description": "Renault API\n===========\n\n|PyPI| |Python Version| |License|\n\n|Read the Docs| |Tests| |Codecov|\n\n|pre-commit| |Ruff|\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/renault-api.svg\n :target: https://pypi.org/project/renault-api/\n :alt: PyPI\n.. |Python Version| image:: https://img.shields.io/pypi/pyversions/renault-api\n :target: https://pypi.org/project/renault-api\n :alt: Python Version\n.. |License| image:: https://img.shields.io/pypi/l/renault-api\n :target: https://opensource.org/licenses/MIT\n :alt: License\n.. |Read the Docs| image:: https://img.shields.io/readthedocs/renault-api/latest.svg?label=Read%20the%20Docs\n :target: https://renault-api.readthedocs.io/\n :alt: Read the documentation at https://renault-api.readthedocs.io/\n.. |Tests| image:: https://github.com/hacf-fr/renault-api/workflows/Tests/badge.svg\n :target: https://github.com/hacf-fr/renault-api/actions?workflow=Tests\n :alt: Tests\n.. |Codecov| image:: https://codecov.io/gh/hacf-fr/renault-api/branch/main/graph/badge.svg\n :target: https://codecov.io/gh/hacf-fr/renault-api\n :alt: Codecov\n.. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white\n :target: https://github.com/pre-commit/pre-commit\n :alt: pre-commit\n.. |Ruff| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n :target: https://github.com/astral-sh/ruff\n :alt: Ruff\n\n\nFeatures\n--------\n\nThis Python package manages the communication with the private Renault API used by the official MyRenault application.\n\nThe client is able to read various vehicle attributes, such as:\n\n* mileage\n* GPS location\n* fuel autonomy (for fuel vehicles)\n* battery autonomy (for electric vehicles)\n* contracts associated to the vehicle (warranty and connected services)\n\nFor some vehicles, it is also possible to manage:\n\n* hvac/pre-conditionning of the vehicle\n* charge schedule\n\nThis package has been developed to be used with Home-Assistant, but it can be used in other contexts\n\n\nRequirements\n------------\n\n* Python (>= 3.8)\n\nAPI Usage\n---------\n\nYou can install *Renault API* via pip_ from PyPI_:\n\n.. code:: console\n\n $ pip install renault-api\n\n.. code:: python\n\n import aiohttp\n import asyncio\n\n from renault_api.renault_client import RenaultClient\n\n async def main():\n async with aiohttp.ClientSession() as websession:\n client = RenaultClient(websession=websession, locale=\"fr_FR\")\n await client.session.login('email', 'password')\n print(f\"Accounts: {await client.get_person()}\") # List available accounts, make a note of kamereon account id\n\n account_id = \"Your Kamereon account id\"\n account = await client.get_api_account(account_id)\n print(f\"Vehicles: {await account.get_vehicles()}\") # List available vehicles, make a note of vehicle VIN\n\n vin = \"Your vehicle VIN\"\n vehicle = await account.get_api_vehicle(vin)\n print(f\"Cockpit information: {await vehicle.get_cockpit()}\")\n print(f\"Battery status information: {await vehicle.get_battery_status()}\")\n\n loop = asyncio.get_event_loop()\n loop.run_until_complete(main())\n\nCLI Usage\n---------\n\nThe renault-api is also available through a CLI, which requires additional dependencies.\nFor the added dependencies, you can install *Renault API* via pip_ from PyPI_:\n\n.. code:: console\n\n $ pip install renault-api[cli]\n\nOnce installed, the following command prompts for credentials and settings, displays basic vehicle status information, and generates traces:\n\n.. code:: console\n\n $ renault-api --log status\n\n* Credentials will automatically be stored in the user home directory (~/.credentials/renault-api.json)\n* Logs will automatically be generated in `logs` subfolder\n\nPlease see the `Command-line Reference <Usage_>`_ for full details.\n\n\nContributing\n------------\n\nContributions are very welcome.\nTo learn more, see the `Contributor Guide`_.\n\n\nLicense\n-------\n\nDistributed under the terms of the MIT_ license,\n*Renault API* is free and open source software.\n\n\nDisclaimer\n----------\n\nThis 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.\n\n\nIssues\n------\n\nIf you encounter any problems,\nplease `file an issue`_ along with a detailed description.\n\n\nCredits\n-------\n\nThis project was generated from `@cjolowicz`_'s `Hypermodern Python Cookiecutter`_ template.\nThis project was heavily based on `@jamesremuscat`_'s `PyZE`_ python client for the Renault ZE API.\n\n\n.. _@cjolowicz: https://github.com/cjolowicz\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _@jamesremuscat: https://github.com/jamesremuscat\n.. _PyZE: https://github.com/jamesremuscat/pyze\n.. _MIT: http://opensource.org/licenses/MIT\n.. _PyPI: https://pypi.org/\n.. _Hypermodern Python Cookiecutter: https://github.com/cjolowicz/cookiecutter-hypermodern-python\n.. _file an issue: https://github.com/hacf-fr/renault-api/issues\n.. _pip: https://pip.pypa.io/\n.. github-only\n.. _Contributor Guide: CONTRIBUTING.rst\n.. _Usage: https://renault-api.readthedocs.io/en/latest/usage.html\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Renault API",
"version": "0.2.8",
"project_urls": {
"Changelog": "https://github.com/hacf-fr/renault-api/releases",
"Documentation": "https://renault-api.readthedocs.io",
"Homepage": "https://github.com/hacf-fr/renault-api",
"Repository": "https://github.com/hacf-fr/renault-api"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "be51dc4c06f4cd25f5bbc81ba4dbda590e84fa067604cdc440d1e2d35e3c08cb",
"md5": "f423a12a89a2d2130405334ed4ccb21c",
"sha256": "32f6b1109b565b471f617a7e8b4ea55d315653f9c53643d8f0c4dadf9461c9bc"
},
"downloads": -1,
"filename": "renault_api-0.2.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f423a12a89a2d2130405334ed4ccb21c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 47269,
"upload_time": "2024-12-02T15:19:01",
"upload_time_iso_8601": "2024-12-02T15:19:01.786818Z",
"url": "https://files.pythonhosted.org/packages/be/51/dc4c06f4cd25f5bbc81ba4dbda590e84fa067604cdc440d1e2d35e3c08cb/renault_api-0.2.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6bdaf3b1ae0099a79b31b38ea59de9870dc979d2b0941f221fd5c28c2025f17f",
"md5": "648319affb04b4e9c3bbd9dab056eda1",
"sha256": "b00c9f37a98fdbc54ff2aa4750be6bef034d2b5b7e6b45fd7e59d2b7e39dd989"
},
"downloads": -1,
"filename": "renault_api-0.2.8.tar.gz",
"has_sig": false,
"md5_digest": "648319affb04b4e9c3bbd9dab056eda1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 35954,
"upload_time": "2024-12-02T15:19:03",
"upload_time_iso_8601": "2024-12-02T15:19:03.629177Z",
"url": "https://files.pythonhosted.org/packages/6b/da/f3b1ae0099a79b31b38ea59de9870dc979d2b0941f221fd5c28c2025f17f/renault_api-0.2.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-02 15:19:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hacf-fr",
"github_project": "renault-api",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "renault-api"
}