Skip to main content

Module to communicate to the EEVEE Mobility API

Project description

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.

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

aioeeveemobility-0.1.3.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

aioeeveemobility-0.1.3-py3-none-any.whl (5.3 kB view hashes)

Uploaded Python 3

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