driveeClient


NamedriveeClient JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryPython client library for automation and control of an EV Wallbox charger via local API or cloud endpoints
upload_time2025-11-12 20:35:32
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT
keywords ev charging wallbox drivee electric-vehicle api-client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Drivee Client

A Python client library for automation and control of EV Wallbox chargers via the Drivee cloud API.

[![PyPI version](https://badge.fury.io/py/drivee-client.svg)](https://badge.fury.io/py/drivee-client)
[![Python Support](https://img.shields.io/pypi/pyversions/drivee-client.svg)](https://pypi.org/project/drivee-client/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Installation

```bash
pip install drivee-client
```

## Quick Start

```python
import asyncio
from drivee_client import DriveeClient

async def main():
    async with DriveeClient("username", "password") as client:
        await client.init()
        
        # Get charge point info
        charge_point = await client.get_charge_point()
        print(f"Charge point: {charge_point.name}")
        print(f"Status: {charge_point.evse.status}")
        
        # Start charging
        response = await client.start_charging()
        print(f"Started session: {response.session.id}")
        
        # Get charging history
        history = await client.get_charging_history()
        for session in history.sessions:
            print(f"Session {session.id}: {session.energy/1000:.2f}kWh")

if __name__ == "__main__":
    asyncio.run(main())
```

## Features

- **Async/await support** - Built with `aiohttp` for non-blocking I/O
- **Type-safe** - Full type hints with Pydantic models
- **Error handling** - Comprehensive error handling with custom exceptions
- **Rate limiting** - Built-in retry logic with exponential backoff
- **Clean architecture** - Separation of DTOs and business models
- **Domain validation** - Business rule validation in model layer

## Architecture

The client library follows a clear separation of concerns with three main layers:

### Data Transfer Objects (DTOs)

Located in `dtos/`, these are pure data classes that:

- Match the exact structure of API responses
- Use Pydantic for validation and serialization
- Have no business logic
- Follow naming convention: All DTO classes end with 'DTO' suffix
- Are only used within the model layer

### Business Models

Located in `models/`, these classes:

- Encapsulate DTOs and provide business logic
- Expose only business-relevant properties and methods
- Use Protocol-based typing for DTO interfaces
- Handle all business rules and validations
- Are the only classes exposed to the Home Assistant integration

### API Client

The `drivee_client.py` handles:

- REST API communication
- Authentication
- Request/response mapping to DTOs
- Error handling and retries

## Installation

1. Copy the `custom_components/drivee` folder to your Home Assistant's `custom_components` directory.
2. Restart Home Assistant.

## Configuration

1. Go to Home Assistant's Settings > Devices & Services
2. Click "Add Integration"
3. Search for "Drivee"
4. Enter your Drivee API base URL
5. (Optional) Enter your API key if required

## Usage

After configuration, you can control your Drivee device through Home Assistant's interface. The integration will create a switch entity that you can use to control your device.

## Development

To develop or modify this integration:

1. Clone this repository
2. Install dependencies:

   ```bash
   pip install -r requirements.txt
   ```

3. Make your changes
4. Test the integration locally
5. Copy the modified files to your Home Assistant's `custom_components` directory

## License

MIT License

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "driveeClient",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Your Name <your.email@example.com>",
    "keywords": "ev, charging, wallbox, drivee, electric-vehicle, api-client",
    "author": null,
    "author_email": "Your Name <your.email@example.com>",
    "download_url": "https://files.pythonhosted.org/packages/bb/a3/05e7036845381938b73d83d4c4aab211e3de4ce3347595b2701b7317ce02/driveeclient-0.1.0.tar.gz",
    "platform": null,
    "description": "# Drivee Client\n\nA Python client library for automation and control of EV Wallbox chargers via the Drivee cloud API.\n\n[![PyPI version](https://badge.fury.io/py/drivee-client.svg)](https://badge.fury.io/py/drivee-client)\n[![Python Support](https://img.shields.io/pypi/pyversions/drivee-client.svg)](https://pypi.org/project/drivee-client/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Installation\n\n```bash\npip install drivee-client\n```\n\n## Quick Start\n\n```python\nimport asyncio\nfrom drivee_client import DriveeClient\n\nasync def main():\n    async with DriveeClient(\"username\", \"password\") as client:\n        await client.init()\n        \n        # Get charge point info\n        charge_point = await client.get_charge_point()\n        print(f\"Charge point: {charge_point.name}\")\n        print(f\"Status: {charge_point.evse.status}\")\n        \n        # Start charging\n        response = await client.start_charging()\n        print(f\"Started session: {response.session.id}\")\n        \n        # Get charging history\n        history = await client.get_charging_history()\n        for session in history.sessions:\n            print(f\"Session {session.id}: {session.energy/1000:.2f}kWh\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Features\n\n- **Async/await support** - Built with `aiohttp` for non-blocking I/O\n- **Type-safe** - Full type hints with Pydantic models\n- **Error handling** - Comprehensive error handling with custom exceptions\n- **Rate limiting** - Built-in retry logic with exponential backoff\n- **Clean architecture** - Separation of DTOs and business models\n- **Domain validation** - Business rule validation in model layer\n\n## Architecture\n\nThe client library follows a clear separation of concerns with three main layers:\n\n### Data Transfer Objects (DTOs)\n\nLocated in `dtos/`, these are pure data classes that:\n\n- Match the exact structure of API responses\n- Use Pydantic for validation and serialization\n- Have no business logic\n- Follow naming convention: All DTO classes end with 'DTO' suffix\n- Are only used within the model layer\n\n### Business Models\n\nLocated in `models/`, these classes:\n\n- Encapsulate DTOs and provide business logic\n- Expose only business-relevant properties and methods\n- Use Protocol-based typing for DTO interfaces\n- Handle all business rules and validations\n- Are the only classes exposed to the Home Assistant integration\n\n### API Client\n\nThe `drivee_client.py` handles:\n\n- REST API communication\n- Authentication\n- Request/response mapping to DTOs\n- Error handling and retries\n\n## Installation\n\n1. Copy the `custom_components/drivee` folder to your Home Assistant's `custom_components` directory.\n2. Restart Home Assistant.\n\n## Configuration\n\n1. Go to Home Assistant's Settings > Devices & Services\n2. Click \"Add Integration\"\n3. Search for \"Drivee\"\n4. Enter your Drivee API base URL\n5. (Optional) Enter your API key if required\n\n## Usage\n\nAfter configuration, you can control your Drivee device through Home Assistant's interface. The integration will create a switch entity that you can use to control your device.\n\n## Development\n\nTo develop or modify this integration:\n\n1. Clone this repository\n2. Install dependencies:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Make your changes\n4. Test the integration locally\n5. Copy the modified files to your Home Assistant's `custom_components` directory\n\n## License\n\nMIT License\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python client library for automation and control of an EV Wallbox charger via local API or cloud endpoints",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://github.com/yourusername/drivee-client#readme",
        "Homepage": "https://github.com/yourusername/drivee-client",
        "Issues": "https://github.com/yourusername/drivee-client/issues",
        "Repository": "https://github.com/yourusername/drivee-client"
    },
    "split_keywords": [
        "ev",
        " charging",
        " wallbox",
        " drivee",
        " electric-vehicle",
        " api-client"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e5b9ff2dbdf1ceb0ee6def76ef5e72c57e5de0c49fda3e2f0f895cbdc201369b",
                "md5": "3a0f6babd3cb3f2694969afc8aae3dd1",
                "sha256": "a37de9d5ab27f28823369d72b32b9c80e013e54e45222e72a03c9be8844ca23f"
            },
            "downloads": -1,
            "filename": "driveeclient-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a0f6babd3cb3f2694969afc8aae3dd1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 26247,
            "upload_time": "2025-11-12T20:35:31",
            "upload_time_iso_8601": "2025-11-12T20:35:31.209981Z",
            "url": "https://files.pythonhosted.org/packages/e5/b9/ff2dbdf1ceb0ee6def76ef5e72c57e5de0c49fda3e2f0f895cbdc201369b/driveeclient-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "bba305e7036845381938b73d83d4c4aab211e3de4ce3347595b2701b7317ce02",
                "md5": "2043a55e745a69c646eb381337a7e209",
                "sha256": "03d8061134ccc2d672da0471cc6f9fd4602d73fe6486c69d832086d696578199"
            },
            "downloads": -1,
            "filename": "driveeclient-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2043a55e745a69c646eb381337a7e209",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 22296,
            "upload_time": "2025-11-12T20:35:32",
            "upload_time_iso_8601": "2025-11-12T20:35:32.385645Z",
            "url": "https://files.pythonhosted.org/packages/bb/a3/05e7036845381938b73d83d4c4aab211e3de4ce3347595b2701b7317ce02/driveeclient-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-11-12 20:35:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "drivee-client#readme",
    "github_not_found": true,
    "lcname": "driveeclient"
}
        
Elapsed time: 0.50348s