Skip to main content

🏥 MedKit: A Unified Platform for Medical Data APIs

CI Status Python 3.9+ License: MIT

MedKit is a high-performance, unified SDK that transforms fragmented medical data APIs into a single, programmable platform. It provides a clean interface for OpenFDA, PubMed, and ClinicalTrials.gov, augmented with a clinical intelligence layer and relationship mapping.

MedKit CLI Demo

✨ Quick Example

from medkit import MedKit

with MedKit() as med:
    # Query trials directly in plain English
    results = med.ask("clinical trials for melanoma")
    
    # Real Output Example:
    # Trials:
    # • Phase III Pembrolizumab Trial
    # • Targeted BRAF Therapy Study
    print(results.trials[0].title)

🤔 Why MedKit?

Feature Without MedKit With MedKit
Integrations 3 separate APIs / SDKs One unified client
Queries 3 fragmented formats One schema & ask() engine
Logic Manual data correlation Native knowledge graphs
Speed Ad-hoc caching Built-in Disk/Memory Cache

🏗️ Architecture

MedKit abstracts complexity through a multi-layered provider system:

      Developer / User
             │
             ▼
    ┌───────────────────┐
    │   MedKit Client   │ (Sync / Async)
    └─────────┬─────────┘
              │
    ┌─────────┴─────────────────────┐
    │       Intelligence Layer      │
    │  ├─ Ask Engine (Routing)      │
    │  ├─ Graph Engine (Context)    │
    │  └─ Interaction Engine        │
    └─────────┬─────────────────────┘
              │
    ┌─────────┴─────────────────────┐
    │       Providers Layer         │
    │  ├─ OpenFDA     (Drug Label)  │
    │  ├─ PubMed      (Research)    │
    │  └─ ClinTrials  (Studies)     │
    └───────────────────────────────┘

🚀 Core Platform Features

  • Clinical Interaction Engine: High-fidelity detection of drug-drug contraindications via med.interactions().
  • Capability-Based Routing: Intelligent query routing based on provider capabilities.
  • Actionable Research: Native URL generation for all papers and trials with direct CLI opening (--open).
  • Natural Language Engine (med.ask()): Query medical data in plain English with automated query sanitization.
  • Medical Relationship Graph (med.graph()): Visualize connections with descriptive, title-based node labeling.
  • Provider Health Dashboard: Real-time status and latency tracking via medkit status.
  • Research Data Export: Native CSV and JSON export for medical researchers.
  • Async & Sync Support: High-concurrency support with AsyncMedKit.

📂 Data Providers

MedKit currently integrates the following foundational medical databases:

  • OpenFDA: Official drug labels, safety information, and manufacturing data from the U.S. Food and Drug Administration.
  • PubMed: The world's largest biomedical research database, providing access to over 35 million citations.
  • ClinicalTrials.gov: A comprehensive database of privately and publicly funded clinical studies conducted around the world.

📦 Installation

pip install medkit-sdk

📖 Quick Start

1. Check Drug Interactions

from medkit import MedKit

with MedKit() as med:
    # Check for potential risks
    risks = med.interactions(["aspirin", "warfarin"])
    for risk in risks:
        print(f"Risk: {risk['warning'].risk} (Severity: {risk['warning'].severity})")

2. High-Concurrency Search (Async)

from medkit import AsyncMedKit
import asyncio

async def main():
    async with AsyncMedKit() as med:
        results = await med.papers("CRISPR gene editing")
        print(f"Found {len(results)} recent papers.")

asyncio.run(main())

3. Medical Relationship Graph

MedKit's signature feature: a medical knowledge graph. Map how drugs relate to trials and papers.

graph = med.graph("metformin")

Example Output:

Metformin
 ├─ treats → Type 2 Diabetes
 ├─ trial → Phase III Study (NCT012345)
 └─ research → Meta-analysis 2026

4. Extending Providers (Plugins)

MedKit is built on a plugin architecture. You can easily add custom data sources.

from medkit.providers.base import BaseProvider

class MyPrivateDB(BaseProvider):
    name = "privatedb"
    
    def search_sync(self, query: str):
        return {"data": "..."}

with MedKit() as med:
    med.register_provider(MyPrivateDB())

🖥️ CLI Power Tools

Provider Status

Check the real-time health and latency of all integrated medical APIs.

$ medkit status

  MedKit Provider Health  
+-----------------------------------+
| Provider       | Status | Latency |
|----------------+--------+---------|
| openfda        | ONLINE |   120ms |
| pubmed         | ONLINE |   210ms |
| clinicaltrials | ONLINE |   180ms |
+-----------------------------------+

Direct Research Access

Display clickable URLs or open the top result directly in your browser.

$ medkit papers "Alzheimer's" --limit 3 --links --open

Clinical Ask

$ medkit ask "is metformin safe with alcohol?"

🤝 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Development Setup

  1. Clone the repository.
  2. Install dependencies: pip install -e .
  3. Run tests:
pytest

🗺️ Roadmap

  • Phase 2.0: AI-powered research summaries and evidence strength scoring.
  • Phase 2.1: Advanced pharmacogenomics provider integration.
  • Phase 3.0: Local GraphQL API to serve the unified medical mesh.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for medkit-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for medkit-sdk 0.1.0
File Size Uploaded Provenance Actions
medkit_sdk-0.1.0.tar.gz 547.1 kB Without provenance Details for medkit_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for medkit-sdk 0.1.0
File Interpreter ABI Platform Actions
medkit_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for medkit_sdk-0.1.0-py3-none-any.whl

Total release size: 568.7 kB

Release files / medkit_sdk-0.1.0.tar.gz

Download URL medkit_sdk-0.1.0.tar.gz
Size 547.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f1722cfaf6a77f0f34955f70e208eb588bb62ac4b9ceba1f53f0fc5e5c49fcf5
BLAKE2b-256 checksum
How to use checksums
2ce3175d90a84fb047f0c3fafe453079a6409ad2ea243fa661e33920ba38597a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / medkit_sdk-0.1.0-py3-none-any.whl

Download URL medkit_sdk-0.1.0-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f83cb08869eeacab79a33a14c327557b68ec1b3f1dcdc0cedc3eb7b575c558e
BLAKE2b-256 checksum
How to use checksums
9833484c7b64859e5babef27fe32e977c1c24de407fe92be3b79ac776a986ff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for medkit-sdk 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page