Skip to main content

idrive-e2-client

PyPI version Python versions License: MIT

Async Python client for the
IDrive e2 Get Region Endpoint API.

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 backup integration for IDrive e2.


Install

pip install idrive-e2-client

Quick Start

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

pip install idrive-e2-client

For development

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 or pull request.


License

MIT © 2025 Patrick Vorgers

Release files for idrive-e2-client 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for idrive-e2-client 0.1.1
File Size Uploaded
idrive_e2_client-0.1.1.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for idrive-e2-client 0.1.1
File Interpreter ABI Platform
idrive_e2_client-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / idrive_e2_client-0.1.1.tar.gz

Download URL idrive_e2_client-0.1.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3148996791eed8849152f144c9a266d17c0b36e0f85f6baeee121f62236a76e0
BLAKE2b-256 checksum
How to use checksums
2b970f6714ddf14f12e71384b564057a02ed8b69f47a34e56203f238931eb36b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 28, 2026.

Transparency log

Release files / idrive_e2_client-0.1.1-py3-none-any.whl

Download URL idrive_e2_client-0.1.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f44f5965c8881bc7c460d51f9343e24d7a5718f9eae5b2aaa0850a4597fc43da
BLAKE2b-256 checksum
How to use checksums
322096e7562ba9a8f2c81967c4cf232f7db84315ea2900d1a378f4a1e86e3390
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page