Official Python SDK for the MedIntell REST API.
Project description
medintell
Official Python SDK for the MedIntell REST API. Zero third-party dependencies (standard-library only).
Install
pip install medintell
Quickstart
import os
from medintell import MedIntell
mi = MedIntell(api_key=os.environ["MI_KEY"])
# Verify the connection
health = mi.health()
# {"status": "ok", "org_id": "org_3aK9Lm", "role": "manager", "facility_id": "fac_1B7dQ2"}
# Seed reference data in dependency order, reusing the returned ids
dept = mi.departments.create(name="Cardiology", facility_id="fac_1B7dQ2")
doc = mi.doctors.create(name="Dr. Shakshouka Hummusi", department_id=dept["id"], facility_id="fac_1B7dQ2")
payer = mi.payers.create(name="Falafel Assurance Co.")
patient = mi.patients.create(
mrn="MRN-2026-00001",
facility_id="fac_1B7dQ2",
first_name="Kabsa",
last_name="Al-Majboos",
dob="1985-03-15",
gender="M",
)
visit = mi.visits.create(
facility_id="fac_1B7dQ2",
patient_mrn="MRN-2026-00001",
source_visit_id="V-2026-12345",
visit_date="2026-06-15T10:30:00",
type_of_visit="Consultation",
department_id=dept["id"],
doctor_id=doc["id"],
payer_id=payer["payer_id"],
total_cost=1500.0,
)
Features
- Resource model —
mi.<resource>.<action>()mirrors the REST API. - Auth — the API key is attached to every request.
- Idempotency — every create sends an
Idempotency-Keyautomatically; passidempotency_key=...to make a specific retry idempotent. - Retries —
429/5xx/ network errors retry with backoff (honoursRetry-After). - Cursor pagination —
for patient in mi.patients.iterate(): .... - Typed errors — failures raise
MedIntellErrorwith.status,.code,.request_id.
Pagination
for patient in mi.patients.iterate(search="MRN-2026"):
print(patient["mrno"])
Errors
from medintell import MedIntell, MedIntellError
try:
mi.patients.retrieve("pat_does_not_exist")
except MedIntellError as err:
print(err.status, err.code, err.request_id)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
medintell-0.1.0.tar.gz
(4.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file medintell-0.1.0.tar.gz.
File metadata
- Download URL: medintell-0.1.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9800862acc9c5ed460c69cf863e1360d224756bd9d77571f2bd34e6c214981a
|
|
| MD5 |
63b46f12fb45f7892009ed299b429964
|
|
| BLAKE2b-256 |
1d5392956200520935b1f9c6b97cca37c1ededd9f8058845c285ac9197e29554
|
File details
Details for the file medintell-0.1.0-py3-none-any.whl.
File metadata
- Download URL: medintell-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
744663ca2740b4d19cc56da00d2f9271696d9f2d29d18f4d6798422906caee0b
|
|
| MD5 |
5db9fa8c136f0d5dcb0d2aa3d6e25080
|
|
| BLAKE2b-256 |
74c38756d271582b7095213e3d9e83b23036848c13a271021dccefdbe9252842
|