# Python SDK

The Birkini Python SDK offers a simple way to programmatically interact with your data across local, subscribed, and published sources.

Documentation is available on [GitHub](https://github.com/Birkini/BirkiniAI). Below are quick usage examples to get started.

```bash
pip install birkini

```

#### Loading Data

The SDK is built around Pandas DataFrames as the primary interface. All records are passed and returned in tabular format.

Your database session key is located in your Birkini settings.

```python
// Some codefrom birkini import Birkini
import pandas as pd

# Initialize client
client = Birkini("YOUR_DB_SESSION_KEY")

# Create a table or append to an existing one
data = pd.DataFrame({
    "id": [1, 2, 3],
    "name": ["Alice", "Bob", "Charlie"],
    "score": [85.5, 92.0, 78.5]
})
client.push("students", data, create_if_missing=True)

```

#### Querying and Transforming Data

Use SQL to retrieve or transform your data, then analyze results directly in Pandas.

```python
# Run a simple SQL query
df = client.execute("SELECT * FROM table_name")

# Perform grouped aggregations
df = client.execute("""
    SELECT
        category,
        COUNT(*) as count,
        AVG(value) as average
    FROM measurements
    GROUP BY category
    HAVING count > 10
    ORDER BY average DESC
""")

# Analyze results
print(df.describe())
print(df.groupby("category").agg({"value": ["mean", "std"]}))

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://birkini.gitbook.io/birkini/data-warehouse/python-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
