Skip to main content

MeMu SDK — Python client for the MeMu medical AI platform (FHIR-ready)

Project description

MeMu Python SDK

Python client library for the MeMu medical AI platform.

Installation

pip install -e ./sdk

Quick Start

from memu import MeMuClient, MedicalEntityExtractor

# Option 1: Cognito client_credentials (recommended for server-to-server)
client = MeMuClient(
    base_url="https://your-api.execute-api.us-east-1.amazonaws.com",
    client_id="<cognito-client-id>",
    client_secret="<cognito-client-secret>",
    token_url="https://your-domain.auth.us-east-1.amazoncognito.com/oauth2/token",
)

# Option 2: Pre-obtained Bearer token
client = MeMuClient(
    base_url="https://your-api.execute-api.us-east-1.amazonaws.com",
    token="<access-token>",
)

# Extract medical entities
extractor = MedicalEntityExtractor(client)
result = extractor.extract_medical_entities(
    transcript="Patient takes Lisinopril 10mg daily for hypertension",
)
print(result)

client.close()

Available Services

Class Method Description
MedicalEntityExtractor extract_medical_entities() Extract medications, diseases, procedures
MedicalEntityExtractorFHIR extract_medical_entities() FHIR Bundle output
DrugInteractionChecker orchestrate_interaction_check() Check drug-drug interactions
DrugInteractionCheckerFHIR orchestrate_interaction_check_fhir() FHIR DetectedIssue output
HCPCSCodeOrchestrator suggest_hcpcs_code() Suggest HCPCS codes
HCPCSCodeOrchestratorFHIR orchestrate_hcpcs_fhir() FHIR Procedure output
ICD10CodeOrchestrator suggest_icd10_code() Suggest ICD-10 codes
ICD10CodeOrchestratorFHIR orchestrate_icd10_fhir() FHIR Condition output
MedicalSummarizer summarize_medical_info() Summarize clinical notes
MedicalSummarizerFHIR summarize_medical_info_fhir() FHIR Composition output
Audio transcribe_audio_file() Transcribe audio files
AudioFHIR transcribe_audio_file() FHIR DocumentReference output

Async client

AsyncMeMuClient mirrors MeMuClient for asyncio apps (e.g. FastAPI), so long-running submit-and-poll never blocks the event loop:

import asyncio
from memu import AsyncMeMuClient

async def main():
    async with AsyncMeMuClient.from_env() as client:
        result = await client.submit_and_poll(
            "/summarization/summarize_medical_info",
            {"transcript": "…", "medical_records": []},
        )
        print(result)

asyncio.run(main())

Both clients share the same resilience: retries with backoff/Retry-After, idempotency-safe POST (never double-creates a task), single 401 re-auth, and base_url validation.

Running Tests

cd sdk
export MEMU_BASE_URL="https://your-api.execute-api.us-east-1.amazonaws.com"
export MEMU_CLIENT_ID="<cognito-client-id>"
export MEMU_CLIENT_SECRET="<cognito-client-secret>"
export MEMU_TOKEN_URL="https://your-domain.auth.us-east-1.amazoncognito.com/oauth2/token"

python3 -m pytest tests/ -v

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

memu_medical-2.0.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

memu_medical-2.0.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file memu_medical-2.0.0.tar.gz.

File metadata

  • Download URL: memu_medical-2.0.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for memu_medical-2.0.0.tar.gz
Algorithm Hash digest
SHA256 326bb06e4a3c29bc20b10179f9082ddc0ff9213fe8572f9dca4a2a28315557bb
MD5 127f51e5f4f0a07b68348e49353ddfd9
BLAKE2b-256 552e791675d546d1ae882fd2884b0e04dd5187e4ede53739bba08aba3c9eeab9

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_medical-2.0.0.tar.gz:

Publisher: sdk-publish.yml on Medical-Multimodal/memu-next

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memu_medical-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: memu_medical-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for memu_medical-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1ff959f0ee65bb980de2bc0752a1bbd5baf29a3fa22d4d947d6add2a8113fe4
MD5 db802c1833b40a4405a18c39151fee55
BLAKE2b-256 01990bfca1b33eb881d9c66a7c48c957fb9b52b403051111d7025161191670b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for memu_medical-2.0.0-py3-none-any.whl:

Publisher: sdk-publish.yml on Medical-Multimodal/memu-next

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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