# DUO Quickstart

## Installation

```bash
pip install "ai4gh[duo]"
```

## Check Data Use Compatibility

```python
from ai4gh.specs.duo.models import DataUseCondition, ResearchPurpose

# Define data use conditions on a dataset
conditions = DataUseCondition(
    codes=["DUO:0000006"],  # Health/Medical/Biomedical research
    description="Use limited to health research",
)

# Define a researcher's intended purpose
purpose = ResearchPurpose(
    codes=["DUO:0000042"],  # General research use
    description="General biomedical research",
)

# Check compatibility
print(f"Dataset conditions: {conditions.codes}")
print(f"Research purpose: {purpose.codes}")
```

## MCP Tool

```json
{
  "tool": "duo_match",
  "arguments": {
    "dataset_conditions": {"codes": ["DUO:0000006"]},
    "research_purpose": {"codes": ["DUO:0000042"]}
  }
}
```

## Common DUO Codes

| Code | Label | Description |
|------|-------|-------------|
| `DUO:0000042` | General research use | No restriction on use |
| `DUO:0000006` | Health/medical/biomedical | Limited to health research |
| `DUO:0000007` | Disease specific | Limited to specific disease |
| `DUO:0000011` | Population origins | Limited to population research |
| `DUO:0000004` | No restriction | Unrestricted access |
| `DUO:0000012` | Research specific restrictions | Custom restrictions |

## Data Models

```python
from ai4gh.specs.duo.models import DataUseCondition, ResearchPurpose, DUOCode
```
