aioeeveemobility

Module to communicate to the EEVEE Mobility API


License
MIT
Install
pip install aioeeveemobility==0.1.3

Documentation

aioeeveemobility

The EEVEE Mobility Client is a Python library for interacting with the EEVEE Mobility API asynchronously using aiohttp.

maintainer buyme_coffee discord

MIT License

GitHub issues Average time to resolve an issue Percentage of issues still open PRs Welcome

Python

github release github release date github last-commit github contributors github commit activity

Installation

You can install the EEVEE Mobility Client via pip:

pip install aioeeveemobility

Usage

"""Test for aioeeveemobility."""
from aioeeveemobility import EeveeMobilityClient

import asyncio

async def main():
    client = EeveeMobilityClient(
        "user@email.com",
        "yourpassword",
    )

    try:
        user = await client.request("user")
        print(f"Hello {user.get('first_name')}")
        fleets = await client.request(f"user/{user.get('id')}/fleets")
        for fleet in fleets:
            for entity in fleet.get('fleet').get('entities'):
                if entity.get('id') == fleet.get('entity_id'):
                    break
            print(f"Fleet: {fleet.get('fleet').get('name')}, {entity.get('name')} | Payout rate: {fleet.get('payout_rate').get('rate')} {fleet.get('payout_rate').get('currency_code')} {fleet.get('payout_rate').get('suffix')}")

        cars = await client.request("cars")
        for car in cars:
            print(f"Your car: {car.get('display_name')} {car.get('license')}")
            addresses = await client.request(f"cars/{car.get('id')}/addresses")
            print("Addresses:")
            for address in addresses:
                print(f" > {address.get('name')}: {address.get('location')}")
            events = await client.request(f"cars/{car.get('id')}/events")
            print("Events:")
            for event in events.get('data'):
                print(event)

    finally:
        await client._close_session()

asyncio.run(main())

Contributing

Contributions are welcome! Please refer to the Contribution Guidelines for more information.

License

This project is licensed under the MIT License - see the LICENSE file for details.