Skip to main content

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

Interact with the CubeStack API using Python.

Installation

pip install cubestack

Quick Start

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

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

Error Handling

from cubestack.exceptions import NotFoundError

try:
    record = client.records.get("blog-posts", 999)
except NotFoundError:
    print("Record not found")