> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omophub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OMOPHub Python SDK - installation and quickstart

> Get started with the OMOPHub Python SDK - install, authenticate, and run your first concept search, mapping, and FHIR resolve from Python in minutes.

## Prerequisites

* Python 3.10+
* [OMOPHub API key](https://dashboard.omophub.com/api-keys)

## Installation

<CodeGroup>
  ```bash pip theme={null}
  pip install omophub
  ```

  ```bash poetry theme={null}
  poetry add omophub
  ```
</CodeGroup>

## Quick Start

```python theme={null}
import omophub

client = omophub.OMOPHub(api_key="oh_xxxxxxxxx")

# Get a concept
concept = client.concepts.get(201826)
print(concept["concept_name"])  # "Type 2 diabetes mellitus"

# Search concepts
results = client.search.basic("diabetes", page_size=5)
for concept in results["concepts"]:
    print(f"{concept['concept_id']}: {concept['concept_name']}")
```

## Async Usage

```python theme={null}
import omophub
import asyncio

async def main():
    async with omophub.AsyncOMOPHub(api_key="oh_xxx") as client:
        concept = await client.concepts.get(201826)
        print(concept["concept_name"])

asyncio.run(main())
```

## Configuration

```python theme={null}
client = omophub.OMOPHub(
    api_key="oh_xxx",
    timeout=30.0,
    max_retries=3,
    vocab_version="2025.1",
)
```

You can also set your API key via environment variable:

```bash theme={null}
export OMOPHUB_API_KEY=oh_xxxxxxxxx
```

```python theme={null}
# API key is read from environment
client = omophub.OMOPHub()
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Concepts" icon="lightbulb" href="/sdks/python/concepts">
    Get, batch, and explore concepts
  </Card>

  <Card title="Search" icon="magnifying-glass" href="/sdks/python/search">
    Search and autocomplete
  </Card>

  <Card title="Mappings" icon="diagram-project" href="/sdks/python/mappings">
    Map between vocabularies
  </Card>

  <Card title="Error Handling" icon="shield-exclamation" href="/sdks/python/error-handling">
    Handle API errors gracefully
  </Card>
</CardGroup>
