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

# Python SDK

> Use CubeStack with Python.

# Python SDK

Interact with the CubeStack API using Python.

## Installation

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

## Quick Start

```python theme={null}
from cubestack import CubeStack

client = CubeStack(api_key="your-api-key", project="my-project")

# Fetch records
result = client.records.list("blog-posts", page=1, page_size=10, sort="created_at", order="desc")

# Create a record
record = client.records.create("blog-posts", {
    "title": "Hello World",
    "content": "My first post"
})

# Update a record
client.records.update("blog-posts", record["id"], {
    "title": "Updated Title"
})

# Delete a record
client.records.delete("blog-posts", record["id"])
```

## Filtering

```python theme={null}
result = client.records.list("blog-posts", filters={
    "status": {"eq": "published"},
    "views": {"gt": 100}
})
```

## Error Handling

```python theme={null}
from cubestack.exceptions import NotFoundError

try:
    record = client.records.get("blog-posts", 999)
except NotFoundError:
    print("Record not found")
```
