Skip to main content

eoir-api-client

Sync and async clients for eoir-api.

Install

pip install eoir-api-client

Usage

import eoir_api_client

with eoir_api_client.Client("https://eoir-api.example.com", "my-api-key") as client:
    result = client.lookup("123456789", "Mexico")
    # result.case is a Case object
    print(result.case.name)
    # result.acis is the raw ACIS payload
    print(result.acis)

Async usage

AsyncClient has the same interface as Client.

import asyncio

import eoir_api_client


async def main() -> None:
    async with eoir_api_client.AsyncClient(
        "https://eoir-api.example.com", "my-api-key"
    ) as client:
        result = await client.lookup("123456789", "Mexico")
        print(result.case.name)


asyncio.run(main())

Retries

The client never retries on its own. Handle the following exceptions in your own retry logic:

  • RetryLaterError: wait error.retry_after seconds before retrying the request.
  • ServerError, NetworkError: retry 2-4 times with exponential backoff.

Blocking example

import time

import eoir_api_client

N_RETRIES = 3


def lookup(a_number: str, nationality: str) -> eoir_api_client.LookupResult:
    with eoir_api_client.Client("https://eoir-api.example.com", "my-api-key") as client:
        for attempt in range(N_RETRIES):
            try:
                return client.lookup(a_number, nationality)
            except eoir_api_client.RetryLaterError as error:
                # Sleep the amount the server tells us to wait
                time.sleep(error.retry_after)
            except (eoir_api_client.ServerError, eoir_api_client.NetworkError):
                # Exponential backoff
                time.sleep(2**attempt)
        return client.lookup(a_number, nationality)

Celery example

import eoir_api_client


@app.task(bind=True, max_retries=3)
def lookup_case(self, a_number: str, nationality: str) -> dict:
    with eoir_api_client.Client("https://eoir-api.example.com", "my-api-key") as client:
        try:
            result = client.lookup(a_number, nationality)
        except eoir_api_client.RetryLaterError as error:
            # Retry after the amount the server tells us to wait
            raise self.retry(exc=error, countdown=error.retry_after)
        except (eoir_api_client.ServerError, eoir_api_client.NetworkError) as error:
            # Exponential backoff
            raise self.retry(exc=error, countdown=2**self.request.retries)
        else:
            return result.acis

Metadata

Release files for eoir-api-client 1.2.0

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

Source distribution (sdist)

Source distribution for eoir-api-client 1.2.0
File Size Uploaded Provenance Actions
eoir_api_client-1.2.0.tar.gz 16.2 kB With provenance Details for eoir_api_client-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for eoir-api-client 1.2.0
File Interpreter ABI Platform Actions
eoir_api_client-1.2.0-py3-none-any.whl Python 3 none any Details for eoir_api_client-1.2.0-py3-none-any.whl

Total release size: 34.3 kB

Release files / eoir_api_client-1.2.0.tar.gz

Download URL eoir_api_client-1.2.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b61c7f05e79eba675f1e0053e9aa8c2afa81cb447a303995492e835a112cc8f2
BLAKE2b-256 checksum
How to use checksums
0a8eeef2b4d257b4a83a8af682ee5e7949e6218f5877f73a44f61ed7e9f265d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Release files / eoir_api_client-1.2.0-py3-none-any.whl

Download URL eoir_api_client-1.2.0-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44892d473fb68f2268eb5dc44cd3bf139a38f101421b9474421884407a0e8e43
BLAKE2b-256 checksum
How to use checksums
ae9065c8bcc6e6442b0389e30c63d821a98925ab76587e8e9c7f75a02afd0014
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 27, 2026.

Transparency log

Security for eoir-api-client 1.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for eoir_api_client-1.2.0.tar.gz

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 Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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