How infermedica/python-api works
Project type and purpose
• This is a Python client SDK (library) that wraps the Infermedica medical-diagnostic REST API (versions v2 & v3).
• It provides multiple “connectors” (Basic, Standard, Model) to communicate with the remote API endpoints, model request/response payloads, manage configuration, and expose exceptions.
File structure
• Top-level packaging:
• infermedica_api/ – main library
– connectors/ – versioned connector implementations (v2, v3) and common code
– webservice.py – HTTP client abstraction
– exceptions.py – SDK-specific exceptions
• examples/ – runnable scripts showing use of each API version
• setup.py, requirements.txt – packaging and dependencies
• Under connectors/v2 and connectors/v3:
• basic.py, standard.py, model.py (in v2) – three integration levels
• models/ (only in v2 Model connector) – classes representing API entities
• standard.py in v3 – high-level connector based on basic.py
• README details configuration, use cases, global vs. local connector registration, and exception types.
README for additional insights
• SDK supports two API versions (v2, v3).
• Three abstraction levels per version: Basic (raw HTTP), Standard (typed signatures), Model (domain-model objects).
• Configurable globally via infermedica_api.configure or locally by instantiating a connector.
• Error handling with custom exception classes.
• Examples folder maps 1:1 to connector methods.
Elements
• Blue for client application
• Green for SDK layers (connectors, webservice, models)
• Orange for external systems (REST API)
– Group related components (e.g., v2 connectors in one cluster, v3 connectors in another)