Skip to main content

Documentation Index

Fetch the complete documentation index at: https://sourcetable.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Sourcetable’s AI runs Python code under the hood to perform complex data transformations, statistical analysis, and visualizations. You don’t need to write Python yourself — the AI generates and executes it based on your natural language instructions.

How it works

When you ask the AI to perform an operation that benefits from code execution, it:
  1. Generates Python code tailored to your request
  2. Executes it against your spreadsheet data
  3. Returns the results (tables, charts, statistics, or transformed data)
  4. Optionally shows you the code it ran

Available libraries

LibraryCategoryCapabilities
pandasData manipulationDataframes, groupby, merge, pivot, filtering, reshaping, time series
NumPyNumerical computingArrays, linear algebra, random sampling, mathematical operations
SciPyScientific computingStatistical tests (t-test, chi-square, ANOVA), distributions, optimization, signal processing
StatsModelsStatistical analysisRegression (OLS, logistic, Poisson), time series (ARIMA, SARIMAX), hypothesis testing
scikit-learnMachine learningClassification, regression, clustering, dimensionality reduction, preprocessing, model evaluation
matplotlibStatic visualizationPublication-quality charts, custom layouts, export to image
plotlyInteractive visualizationInteractive charts, 3D plots, dashboards, hover tooltips
seabornStatistical visualizationHeatmaps, pair plots, distribution plots, regression plots
bokehInteractive visualizationBrowser-based interactive charts, streaming data
transformersNLP / Deep learningHugging Face models for text classification, summarization, translation, sentiment analysis
TabPFNAutoMLIn-context learning for tabular prediction and classification without training
BeautifulSoupWeb scrapingHTML/XML parsing, data extraction from web pages
SQLAlchemyDatabaseORM, database connectivity, query building
DuckDBIn-browser SQLFast analytical queries on dataframes and files, process multi-GB datasets
huggingface-hubModel hubAccess and download models from the Hugging Face Hub
PyodidePython runtimePython execution in the browser via WebAssembly
dbtData transformationSQL-based data transformation pipelines
Apache ArrowData processingColumnar in-memory data format for fast analytics

Example operations

Data normalization

Ask: “Normalize the revenue column using min-max scaling”
from sklearn.preprocessing import MinMaxScaler
import pandas as pd

scaler = MinMaxScaler()
df['revenue_normalized'] = scaler.fit_transform(df[['revenue']])

Statistical testing

Ask: “Run a t-test comparing revenue between Group A and Group B”
from scipy import stats

group_a = df[df['group'] == 'A']['revenue']
group_b = df[df['group'] == 'B']['revenue']
t_stat, p_value = stats.ttest_ind(group_a, group_b)
# Returns: t-statistic, p-value, and interpretation

Time series forecasting

Ask: “Forecast next quarter’s revenue using ARIMA”
from statsmodels.tsa.arima.model import ARIMA

model = ARIMA(df['monthly_revenue'], order=(1, 1, 1))
results = model.fit()
forecast = results.forecast(steps=3)

Correlation heatmap

Ask: “Show me a correlation heatmap of all numeric columns”
import seaborn as sns
import matplotlib.pyplot as plt

corr = df.select_dtypes(include='number').corr()
sns.heatmap(corr, annot=True, cmap='coolwarm', center=0)

Feature engineering

Ask: “Create a customer lifetime value feature from order history”
import pandas as pd

clv = df.groupby('customer_id').agg(
    total_spend=('order_total', 'sum'),
    order_count=('order_id', 'count'),
    avg_order_value=('order_total', 'mean'),
    tenure_days=('order_date', lambda x: (x.max() - x.min()).days)
)
clv['predicted_ltv'] = clv['avg_order_value'] * clv['order_count'] * 1.2

When Python is used vs. spreadsheet formulas

The AI uses Python when…The AI uses spreadsheet formulas when…
Statistical tests or ML models are neededSimple calculations (SUM, AVERAGE, IF)
Complex data reshaping or pivotingLookups (VLOOKUP, INDEX/MATCH)
Multi-step data transformationsCell-level formatting or conditional logic
Generating charts or visualizationsBasic math across columns
Processing external data (web scraping, APIs)String manipulation (CONCATENATE, TRIM)
Working with very large datasetsSingle-column operations

Viewing and modifying the code

To see the code the AI executed:
  • Ask “Show me the code you used” or “What Python did you run?”
  • The AI displays the full code in the chat response
  • You can copy the code, modify it, and ask the AI to re-run your version

SQL execution

The AI also runs SQL queries using DuckDB:
SELECT region, SUM(revenue) as total
FROM sheet_data
WHERE year = 2024
GROUP BY region
ORDER BY total DESC
SQL queries can target both spreadsheet data (via DuckDB) and connected databases.

MCP execution

The execute_mcp tool lets the AI call external tools through the Model Context Protocol. This extends capabilities to:
  • Web scraping via Apify MCP connector
  • Custom APIs through configured MCP servers
  • Third-party tools that support the MCP protocol

Performance notes

  • Python execution runs server-side, not in your browser
  • Large operations are processed asynchronously
  • Results stream back as they’re ready
  • The AI manages memory and execution limits automatically