# idrive-e2-client
[](https://pypi.org/project/idrive-e2-client/)
[](https://pypi.org/project/idrive-e2-client/)
[](LICENSE)
Async Python client for the
[IDrive e2 Get Region Endpoint API](https://www.idrive.com/s3-storage-e2/guides/get_region_endpoint).
This library provides a minimal, typed wrapper around the IDrive e2 region lookup call:
- 🔑 Fetch the correct **endpoint URL** for an access key
- 🚦 Handle invalid credentials and network errors with clean exceptions
- âš¡ Async-first design, built on `aiohttp`
It is lightweight, minimal, and used by the [Home Assistant](https://www.home-assistant.io/) backup integration for IDrive e2.
---
## Install
```bash
pip install idrive-e2-client
```
---
## Quick Start
```python
import asyncio
import aiohttp
from idrive_e2 import IDriveE2Client, InvalidAuth, CannotConnect
ACCESS_KEY = "..."
async def main():
async with aiohttp.ClientSession() as session:
client = IDriveE2Client(session)
try:
endpoint = await client.get_region_endpoint(ACCESS_KEY)
print("Resolved endpoint:", endpoint)
except InvalidAuth:
print("Invalid credentials")
except CannotConnect:
print("Cannot connect to IDrive e2")
asyncio.run(main())
```
---
## Why?
Before you can connect to IDrive e2 with standard S3 tools,
you must call the **Get Region Endpoint** API to determine the correct regional endpoint.
This client wraps that step into a reusable Python package with a simple, async method.
---
## Installation
```bash
pip install idrive-e2-client
```
### For development
```bash
git clone https://github.com/patrickvorgers/idrive-e2-client.git
cd idrive-e2-client
pip install -e .[dev]
```
---
## API
### `IDriveE2Client(session: aiohttp.ClientSession)`
Create a new client instance using an aiohttp session.
### `await client.get_region_endpoint(access_key: str) -> str`
Resolve and return the correct endpoint URL for the given access key.
The returned string is normalized to include a scheme (e.g., `https://...`).
**Raises**
- `InvalidAuth` → credentials not valid
- `CannotConnect` → API not reachable/bad response/malformed data
---
## Exceptions
- `InvalidAuth` -> credentials not valid
- `CannotConnect` -> API not reachable or bad response
- `IDriveE2Error` -> base class for all errors
---
## Contributing
Contributions are welcome! Please open an [issue](../../issues) or [pull request](../../pulls).
---
## License
MIT © 2025 Patrick Vorgers
Raw data
{
"_id": null,
"home_page": null,
"name": "idrive-e2-client",
"maintainer": "Patrick Vorgers",
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "idrive, e2, s3, region, client, async, aiohttp",
"author": "Patrick Vorgers",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/39/cf/a60d69551d3e1a6143eb05a80aec49b28019b5c637afbe0f55b3c162ed83/idrive_e2_client-0.1.0.tar.gz",
"platform": null,
"description": "# idrive-e2-client\r\n\r\n[](https://pypi.org/project/idrive-e2-client/)\r\n[](https://pypi.org/project/idrive-e2-client/)\r\n[](LICENSE)\r\n\r\nAsync Python client for the \r\n[IDrive e2 Get Region Endpoint API](https://www.idrive.com/s3-storage-e2/guides/get_region_endpoint).\r\n\r\nThis library provides a minimal, typed wrapper around the IDrive e2 region lookup call:\r\n\r\n- \ud83d\udd11 Fetch the correct **endpoint URL** for an access key \r\n- \ud83d\udea6 Handle invalid credentials and network errors with clean exceptions \r\n- \u26a1 Async-first design, built on `aiohttp` \r\n\r\nIt is lightweight, minimal, and used by the [Home Assistant](https://www.home-assistant.io/) backup integration for IDrive e2.\r\n\r\n---\r\n\r\n## Install\r\n\r\n```bash\r\npip install idrive-e2-client\r\n```\r\n\r\n---\r\n\r\n## Quick Start\r\n\r\n```python\r\nimport asyncio\r\nimport aiohttp\r\nfrom idrive_e2 import IDriveE2Client, InvalidAuth, CannotConnect\r\n\r\nACCESS_KEY = \"...\"\r\n\r\nasync def main():\r\n async with aiohttp.ClientSession() as session:\r\n client = IDriveE2Client(session)\r\n try:\r\n endpoint = await client.get_region_endpoint(ACCESS_KEY)\r\n print(\"Resolved endpoint:\", endpoint)\r\n except InvalidAuth:\r\n print(\"Invalid credentials\")\r\n except CannotConnect:\r\n print(\"Cannot connect to IDrive e2\")\r\n\r\nasyncio.run(main())\r\n```\r\n\r\n---\r\n\r\n## Why?\r\n\r\nBefore you can connect to IDrive e2 with standard S3 tools, \r\nyou must call the **Get Region Endpoint** API to determine the correct regional endpoint. \r\n\r\nThis client wraps that step into a reusable Python package with a simple, async method.\r\n\r\n---\r\n\r\n## Installation\r\n\r\n```bash\r\npip install idrive-e2-client\r\n```\r\n\r\n### For development\r\n\r\n```bash\r\ngit clone https://github.com/patrickvorgers/idrive-e2-client.git\r\ncd idrive-e2-client\r\npip install -e .[dev]\r\n```\r\n---\r\n\r\n## API\r\n\r\n### `IDriveE2Client(session: aiohttp.ClientSession)`\r\n\r\nCreate a new client instance using an aiohttp session.\r\n\r\n### `await client.get_region_endpoint(access_key: str) -> str`\r\n\r\nResolve and return the correct endpoint URL for the given access key. \r\nThe returned string is normalized to include a scheme (e.g., `https://...`).\r\n\r\n**Raises** \r\n- `InvalidAuth` \u2192 credentials not valid \r\n- `CannotConnect` \u2192 API not reachable/bad response/malformed data \r\n\r\n---\r\n\r\n## Exceptions\r\n\r\n- `InvalidAuth` -> credentials not valid \r\n- `CannotConnect` -> API not reachable or bad response \r\n- `IDriveE2Error` -> base class for all errors \r\n\r\n---\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please open an [issue](../../issues) or [pull request](../../pulls).\r\n\r\n---\r\n\r\n## License\r\n\r\nMIT \u00a9 2025 Patrick Vorgers\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Async Python client for the IDrive e2 Get Region Endpoint API (returns only endpoint URL).",
"version": "0.1.0",
"project_urls": {
"Changelog": "https://github.com/patrickvorgers/idrive-e2-client/releases",
"Homepage": "https://github.com/patrickvorgers/idrive-e2-client",
"Issues": "https://github.com/patrickvorgers/idrive-e2-client/issues",
"Repository": "https://github.com/patrickvorgers/idrive-e2-client"
},
"split_keywords": [
"idrive",
" e2",
" s3",
" region",
" client",
" async",
" aiohttp"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ec6db2bf522e61e0f96594e56b6ea19219a69b67e8bef65a3efcb64ea7a908c7",
"md5": "202579e2fd31825a35036e226e52ad18",
"sha256": "6017b9486205a6b770383a73ea04b4fe1d27f981a3749833d882d07f4af228d5"
},
"downloads": -1,
"filename": "idrive_e2_client-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "202579e2fd31825a35036e226e52ad18",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 5463,
"upload_time": "2025-08-20T19:25:03",
"upload_time_iso_8601": "2025-08-20T19:25:03.370767Z",
"url": "https://files.pythonhosted.org/packages/ec/6d/b2bf522e61e0f96594e56b6ea19219a69b67e8bef65a3efcb64ea7a908c7/idrive_e2_client-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "39cfa60d69551d3e1a6143eb05a80aec49b28019b5c637afbe0f55b3c162ed83",
"md5": "384e32d83a4241f1a3961e8536b144a6",
"sha256": "444f40c3e03ca16f34ad76313e18fbb1f4fc9b0582b504caa8104e3f82ba9e60"
},
"downloads": -1,
"filename": "idrive_e2_client-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "384e32d83a4241f1a3961e8536b144a6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 5408,
"upload_time": "2025-08-20T19:25:06",
"upload_time_iso_8601": "2025-08-20T19:25:06.103937Z",
"url": "https://files.pythonhosted.org/packages/39/cf/a60d69551d3e1a6143eb05a80aec49b28019b5c637afbe0f55b3c162ed83/idrive_e2_client-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-20 19:25:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "patrickvorgers",
"github_project": "idrive-e2-client",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "idrive-e2-client"
}