Metadata-Version: 2.4
Name: stedi
Version: 0.0.7
Summary: The Stedi SDK for Python.
Project-URL: Homepage, https://www.stedi.com
Project-URL: Documentation, https://www.stedi.com/docs
Project-URL: Source, https://github.com/Stedi/sdk
Project-URL: Issues, https://github.com/Stedi/sdk/issues
Author: Stedi
License-Expression: Apache-2.0
Keywords: edi,healthcare,sdk,stedi
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Healthcare Industry
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: smithy-aws-core[json]<0.2,>=0.1
Requires-Dist: smithy-core<0.2,>=0.1
Requires-Dist: smithy-http[aiohttp]<0.2,>=0.1
Description-Content-Type: text/markdown

# stedi

[![PyPI](https://img.shields.io/pypi/v/stedi.svg)](https://pypi.org/project/stedi/)
[![Python versions](https://img.shields.io/pypi/pyversions/stedi.svg)](https://pypi.org/project/stedi/)
[![License](https://img.shields.io/pypi/l/stedi.svg)][license]

The Stedi SDK for Python — unified, typed access to Stedi's APIs from a single
client.

## Requirements

- Python ≥ 3.12

## Installing

```sh
pip install stedi
# or: uv add stedi
# or: poetry add stedi
```

## Authentication

Every request is authenticated with a Stedi **API key**, passed when you
construct the client:

```python
from stedi import Stedi

client = Stedi(api_key="...")
```

See the [Stedi documentation][docs] for how to obtain and manage API keys.

## Quickstart

The client is async and used as a context manager. Send a typed operation by
passing its input model:

```python
import asyncio

from stedi import Stedi
from stedi.models import SearchPayersInput


async def main() -> None:
    async with Stedi(api_key="...") as client:
        response = await client.search_payers(SearchPayersInput(query="Aetna"))

        for result in response.items:
            payer = result.payer
            print(f"{payer.stedi_id}\t{payer.display_name}")


asyncio.run(main())
```

> Operation **input models** live under `stedi.models`.

## One client for every Stedi API

A single client routes each operation to the correct Stedi host automatically —
one client and one set of credentials for the whole SDK.

```python
from stedi import Stedi
from stedi.models import SearchPayersInput, ClaimsCms1500SubmissionInput


async def main() -> None:
    async with Stedi(api_key="...") as client:
        # Payers — routed to the payers host.
        await client.search_payers(SearchPayersInput(query="Aetna"))

        # Claims — the same client routes this to the claims host.
        # See the runnable claims example for a complete submission payload.
        await client.claims_cms1500_submission(ClaimsCms1500SubmissionInput(...))
```

## Available operations

| Method | Input model |
| --- | --- |
| `search_payers` | `SearchPayersInput` |
| `claims_cms1500_submission` | `ClaimsCms1500SubmissionInput` |

This list grows as more Stedi APIs are released through the SDK.

## Configuration

For anything beyond the API key, build a `Config` and pass it as `config=`. The
API key can travel on the `Config` or stay on the constructor:

```python
from stedi import Stedi
from stedi_core.config import Config
from smithy_core.retries import SimpleRetryStrategy


async def main() -> None:
    config = Config(
        # Retry policy — defaults to SimpleRetryStrategy(max_attempts=5).
        retry_strategy=SimpleRetryStrategy(max_attempts=8),
    )

    async with Stedi(api_key="...", config=config) as client:
        ...
```

`Config` also accepts `interceptors` (hooks around each request) and other
low-level transport options. See the `Config` constructor for the full surface.

## Error handling

Service errors are raised as `CallError`:

```python
from smithy_core.exceptions import CallError


async def main() -> None:
    async with Stedi(api_key="...") as client:
        try:
            await client.search_payers(SearchPayersInput(query="Aetna"))
        except CallError as exc:
            print(f"{type(exc).__name__}: {exc}")
            raise
```

## Examples

Runnable, end-to-end examples for every operation live in the
[`examples/python/`][examples] directory of the repository.

## Documentation & support

- Stedi documentation: [stedi.com/docs][docs]
- Issues: [github.com/Stedi/sdk/issues][issues]

## License

Apache-2.0

<!-- Reference links — swap these in one place if URLs change. -->
[docs]: https://www.stedi.com/docs
[examples]: https://github.com/Stedi/sdk/tree/main/examples/python
[issues]: https://github.com/Stedi/sdk/issues
[license]: https://github.com/Stedi/sdk/blob/main/LICENSE
