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

# Python SDK

> Eka Python SDK for assessment

You can take assessments using eka client

### 0. Prerequisites

* Install the eka client using pip:

```bash theme={null}
pip install eka-client
```

* Import the client:

```python theme={null}
from eka_client import EkaClient
```

* Initialize the client:

```python theme={null}
client = EkaClient(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
)
```

#### 1. To start an assessment:

```python theme={null}
first_question_form = client.assessment.start(
    age=20, 
    gender="M", 
    workflow_id=4002,
    practitioner_uuid="example_pract_uuid_123",
    patient_uuid="example_patient_uuid_123",
    unique_identifier="example_unique_id_123",
    context=additional_context
)
```

You can set additional context as a stringified json.

```python theme={null}
import json
additional_context = json.loads(
    {
        "name": "Rakesh",
        "city": "Pune"
    }
)
```

<Tip>[Click here](/api-reference/health-ai/assessment/overview) to know more about eka care assessment platform.</Tip>

#### 2. Continue the assessment (get next question)

To get the next question, you need to answer the first question. The response can be a string for input type questions or a list of strings (ids) for choice type questions.

**get response**

<AccordionGroup>
  <Accordion title="For input type question">
    ```python theme={null}
    user_input = "2001-03-14"  # example date of birth
    first_question_response = response(  # format the user's input
        question=first_question, 
        answer=user_input
    )
    ```
  </Accordion>

  <Accordion title="For choice type question">
    ```python theme={null}
    choice_ids = ["abc", "def"] 
    first_question_response = response(  # format the user's choices
        question=first_question 
        answer=choice_ids
    )
    ```
  </Accordion>
</AccordionGroup>

<Tip>[Click here](/api-reference/health-ai/assessment/assessment-flow/continue/continue-request-formats#types-of-question-components) to know more about types of question component</Tip>

**get the next question using `first_question_response`**

```python theme={null}
client.assessment.next(
    qid=0, 
    user_response=first_response
)
```

#### 3. Submit the assessment when all questions are answered

```python theme={null}
client.assessment.submit()
```
