Python SDK

Load, Query, and Transform Data

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. Below are quick usage examples to get started.

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.

// 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.

# 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"]}))

Last updated