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

# Python SDK Installation

> Install and configure the Structify Python SDK

## Requirements

* Python 3.11 or higher
* pip or uv package manager

## Installation

### Using pip

```bash theme={null}
pip install structifyai
```

### Using uv

```bash theme={null}
uv pip install structifyai
```

### Using Poetry

```bash theme={null}
poetry add structifyai
```

### Development Version

Install the latest development version from GitHub:

```bash theme={null}
pip install git+https://github.com/StructifyAI/agent.git#subdirectory=prospero/python
```

## Configuration

### API Key Setup

Set your API key as an environment variable:

```bash theme={null}
export STRUCTIFY_API_KEY="your_api_key_here"
```

Or in a `.env` file:

```bash theme={null}
STRUCTIFY_API_KEY=your_api_key_here
DATABASE_URL=postgresql://user:pass@localhost:5432/prospero
REDIS_URL=redis://localhost:6379
```

### Initialize the Client

```python theme={null}
from structify import Structify

# Uses STRUCTIFY_API_KEY env var by default
client = Structify()

# Or provide explicitly
client = Structify(api_key="your_api_key_here")
```

## Verify Installation

Test your installation:

```python theme={null}
from structify import Structify

client = Structify()
print(client.health_check())
# Output: {'status': 'healthy'}
```

## Dependencies

The SDK includes these core dependencies:

* `polars`: DataFrame operations
* `httpx`: Async HTTP client
* `pydantic`: Data validation
* `websockets`: Real-time updates

## Environment-Specific Setup

### Local Development

```python theme={null}
from structify import Structify

client = Structify(
    api_key="dev_key",
    base_url="http://localhost:8080"
)
```

### Production

```python theme={null}
from structify import Structify

client = Structify(
    api_key=os.environ["STRUCTIFY_API_KEY"],
    base_url="https://api.structify.ai"
)
```

### Testing

```python theme={null}
import pytest
from structify import Structify

@pytest.fixture
def client():
    return Structify(
        api_key="test_key",
        base_url="http://localhost:8080"
    )
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="ImportError: No module named 'structify'">
    Ensure the package is installed:

    ```bash theme={null}
    pip list | grep structifyai
    ```

    If not listed, reinstall:

    ```bash theme={null}
    pip install --upgrade structifyai
    ```
  </Accordion>

  <Accordion title="Authentication Error">
    Verify your API key:

    ```python theme={null}
    import os
    print(os.environ.get("STRUCTIFY_API_KEY"))
    ```

    Ensure it's set correctly in your environment.
  </Accordion>

  <Accordion title="Connection Error">
    Check the API endpoint:

    ```python theme={null}
    client = Structify(
        base_url="https://api.structify.ai",
        timeout=30
    )
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/sdks/python/quickstart">
    Build your first workflow
  </Card>

  <Card title="API Reference" icon="book" href="/sdks/python/reference">
    Complete SDK reference
  </Card>
</CardGroup>
