API Reference¶
The public Python API is intentionally small. Use the CLI for humans and the API when another Python tool needs structured findings.
Public API¶
mlenvdoctor.api ¶
Public Python API for ML Environment Doctor.
diagnose ¶
Run ML environment diagnostics from Python code.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
full
|
bool
|
Include slower checks such as disk, Docker GPU, and network checks. |
False
|
parallel
|
bool
|
Run independent checks concurrently when possible. |
True
|
Returns:
| Type | Description |
|---|---|
List[DiagnosticIssue]
|
A list of normalized diagnostic findings. |
Source code in src/mlenvdoctor/api.py
Diagnostic Models¶
mlenvdoctor.diagnose.DiagnosticIssue
dataclass
¶
Represents a diagnostic outcome.
Source code in src/mlenvdoctor/diagnose.py
to_row ¶
Convert to table row.
Source code in src/mlenvdoctor/diagnose.py
mlenvdoctor.diagnose.DoctorFinding
dataclass
¶
Prioritized summary item for the doctor command.
Source code in src/mlenvdoctor/diagnose.py
Core Diagnostic Engine¶
mlenvdoctor.diagnose.diagnose_env ¶
diagnose_env(full: bool = False, parallel: bool = True, show_header: bool = True) -> List[DiagnosticIssue]
Run diagnostic checks and return normalized issues.
Source code in src/mlenvdoctor/diagnose.py
mlenvdoctor.diagnose.summarize_for_doctor ¶
Convert detailed issues into prioritized doctor findings.
Source code in src/mlenvdoctor/diagnose.py
Fix Planning¶
mlenvdoctor.fix.FixAction
dataclass
¶
A validated action the fix engine can perform.
Source code in src/mlenvdoctor/fix.py
mlenvdoctor.fix.FixResult
dataclass
¶
Structured result for a fix run.
Source code in src/mlenvdoctor/fix.py
mlenvdoctor.fix.plan_fixes ¶
plan_fixes(issues: List[DiagnosticIssue], *, use_conda: bool, create_venv: bool, stack: str, doctor_findings: Optional[List[DoctorFinding]] = None, requirements_output: str = DEFAULT_REQUIREMENTS_FILE, conda_output: str = 'environment-mlenvdoctor.yml', venv_path: str = '.venv') -> List[FixAction]
Turn diagnostics into a predictable fix plan.