Skip to main content

Official Python SDK for the Rescue Lung Society ingestion API

Project description

rescue-lung-sdk (Python)

Official Python SDK for the Rescue Lung Society ingestion API.

Install

pip install rescue-lung-sdk

Quick start

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rescue_lung_sdk-0.2.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rescue_lung_sdk-0.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file rescue_lung_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: rescue_lung_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for rescue_lung_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3d0ac82ffad20a24a3ad1bf0b26990552c6b77290788481225f76efeef1ef7d2
MD5 2232bb569cfefc955c01d6812126e921
BLAKE2b-256 43a2895247c13f334f8d69e4e2b6c59fc0e86231f9e00eb7c212d511dda4efaa

See more details on using hashes here.

File details

Details for the file rescue_lung_sdk-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rescue_lung_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50e286e7aafb188122f04343f9303977784de8f3177c088aff372505d5c7c272
MD5 15d299c87fc421c05e9a58d95a62f7d7
BLAKE2b-256 bec99ca60570e17944d33559001b99f4eddc7d92f9a6de6dfeba3a7bb9e8974f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page