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.1.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.1.0
File Size Uploaded Provenance Actions
eoir_api_client-1.1.0.tar.gz 16.2 kB With provenance Details for eoir_api_client-1.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 34.3 kB

Release files / eoir_api_client-1.1.0.tar.gz

Download URL eoir_api_client-1.1.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0cf48425b2b708449fd3648f562e908270ad5f90b6c63cbc2b3fbac2dec1e4d3
BLAKE2b-256 checksum
How to use checksums
3008d39a524c735156fc0517d8992d987ef40cbcde1019fe15604770cee7c994
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.1.0-py3-none-any.whl

Download URL eoir_api_client-1.1.0-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9def369392229a69bf72ebddce73c6c130c1414142b3f6b8980f8bba6493c7ef
BLAKE2b-256 checksum
How to use checksums
3868c7729f40a6204ccf05ec405089ee12ada591c72e0bcc0f62845d2c5caaa9
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.1.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.1.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