Metadata-Version: 2.4
Name: rescue-lung-sdk
Version: 0.1.0
Summary: Official Python SDK for the Rescue Lung Society ingestion API
Project-URL: Homepage, https://github.com/MichaelYoung0705/rescue-lung
Project-URL: Issues, https://github.com/MichaelYoung0705/rescue-lung/issues
Author: JMY Cloud Solutions
License: MIT
Keywords: api-client,lung-cancer,registry,rescue-lung,screening
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Healthcare Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: pydantic>=2.9
Provides-Extra: dev
Requires-Dist: datamodel-code-generator>=0.26; extra == 'dev'
Requires-Dist: pytest-httpx>=0.30; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Description-Content-Type: text/markdown

# rescue-lung-sdk (Python)

Official Python SDK for the [Rescue Lung Society](https://github.com/MichaelYoung0705/rescue-lung) ingestion API.

## Install

```bash
pip install rescue-lung-sdk
```

## Quick start

```python
from rescue_lung_sdk import RescueLungClient, PatientRecord, Env

client = RescueLungClient(
    api_key="paste-your-key-here",     # or set RESCUE_LUNG_API_KEY env var
    env=Env.PROD,
)

record = PatientRecord(
    patient_id="P00012345",
    first_name="Jane", last_name="Doe",
    dob="1958-04-12", gender="F",
    exam_date="2026-03-15", indication="B",
    smoking_status="Former", pack_years=32.0,
)
receipt = client.send(record)
print(receipt.exam_id, "inserted:", receipt.is_insert)
```

## Batch upload

```python
batch = client.batch()
batch.add(record1).add(record2)        # collect any number of records
job = batch.send()                     # returns JobReceipt

# Or upload an existing CSV from your EHR export
job = client.send_csv("monthly_exams.csv")

# Poll the job until done
status = client.get_job(job.job_id)
print(status.status, status.success_count, "/", status.row_count)
```

## API key — three ways

1. Constructor: `RescueLungClient(api_key="...")` (highest priority).
2. Environment variable: `RESCUE_LUNG_API_KEY=...` (recommended for CI/production).
3. Edit `rescue_lung_sdk/config.py` and paste the key as the `API_KEY` constant
   (simplest for non-developer integrations; do not commit to public repos).

## Status

**Beta.** The data model, HTTP plumbing (with retry/Retry-After), `BatchBuilder`
CSV helpers, and typed errors are implemented and covered by the test suite. The
API contract (`openapi.yaml`) is the source of truth; pre-1.0, minor versions may
carry breaking changes as the contract evolves.
