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.0.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.0.0
File Size Uploaded Provenance Actions
eoir_api_client-1.0.0.tar.gz 16.1 kB With provenance Details for eoir_api_client-1.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 34.2 kB

Release files / eoir_api_client-1.0.0.tar.gz

Download URL eoir_api_client-1.0.0.tar.gz
Size 16.1 kB
Tags Source
SHA-256 checksum
How to use checksums
031b1fd03077cbf3df76f2aa7b779131a19dd09f7a5ca511b4d3a839039e37b0
BLAKE2b-256 checksum
How to use checksums
74bb2bb144e680866d49e261d0aec66e73bdb00175c7aa926301e8909a73c9f2
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 23, 2026.

Transparency log

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

Download URL eoir_api_client-1.0.0-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
704713bb225151ec7895e689e6a169e99fe4eb19b5e15a84a169723b86973a8f
BLAKE2b-256 checksum
How to use checksums
2d70270e8a10a74c11788a3b1c6edb33423bd57a85b4f02cfc162998b0385877
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 23, 2026.

Transparency log

Security for eoir-api-client 1.0.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.0.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 23, 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