Skip to main content

Async Python client for the IDrive e2 Get Region Endpoint API (returns only endpoint URL).

Project description

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

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

idrive_e2_client-0.1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

idrive_e2_client-0.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file idrive_e2_client-0.1.1.tar.gz.

File metadata

  • Download URL: idrive_e2_client-0.1.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for idrive_e2_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3148996791eed8849152f144c9a266d17c0b36e0f85f6baeee121f62236a76e0
MD5 61d484686145592ccd2d9671fb7f5163
BLAKE2b-256 2b970f6714ddf14f12e71384b564057a02ed8b69f47a34e56203f238931eb36b

See more details on using hashes here.

Provenance

The following attestation bundles were made for idrive_e2_client-0.1.1.tar.gz:

Publisher: release.yml on patrickvorgers/idrive-e2-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file idrive_e2_client-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for idrive_e2_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f44f5965c8881bc7c460d51f9343e24d7a5718f9eae5b2aaa0850a4597fc43da
MD5 c15a0c2932a3663e39b9d750f82bb651
BLAKE2b-256 322096e7562ba9a8f2c81967c4cf232f7db84315ea2900d1a378f4a1e86e3390

See more details on using hashes here.

Provenance

The following attestation bundles were made for idrive_e2_client-0.1.1-py3-none-any.whl:

Publisher: release.yml on patrickvorgers/idrive-e2-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page