Core API & CLI

Get started with the MedKit client and CLI right out of the box.

1. Installation

MedKit requires Python 3.9+. We recommend setting up a virtual environment before installing.

pip install medkit-sdk

If you prefer `Poetry` or `uv` for dependency management:

poetry add medkit-sdk
# OR
uv pip install medkit-sdk

2. The CLI

MedKit comes with a built-in CLI, letting you easily query health data right from your terminal. You'll get clean, color-coded tables out of the box.

System Status Check

Verify that the upstream providers (OpenFDA, PubMed, and ClinicalTrials.gov) are online and responding properly:

$ medkit status

       MedKit Provider Health
┏━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓
┃ Provider       ┃ Status ┃ Latency ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩
│ openfda        │ ONLINE │   267ms │
│ pubmed         │ ONLINE │   408ms │
│ clinicaltrials │ ONLINE │   421ms │
└────────────────┴────────┴─────────┘

Command Reference

3. Python Usage

MedKit is designed to have no necessary configuration when installed. The SDK automatically routes your requests through the generous public free-tiers provided by OpenFDA, PubMed, and ClinicalTrials.gov right out of the box.

To keep your application blazing fast and to manage HTTP connection pools automatically, simply use `AsyncMedKit` as an async context manager in your application code:

import asyncio
from medkit import AsyncMedKit

async def main():
    # Context manager initializes underlying HTTP/2 pools automatically
    async with AsyncMedKit() as med:
        
        # All provider connections are now warm and ready
        is_healthy = await med.health_check()
        print(f"System Health: {is_healthy}")

if __name__ == "__main__":
    asyncio.run(main())
Next: The Ask Engine →