Skip to main content

Squirrels

Squirrels is an API framework that lets you create REST APIs for dynamic data analytics!

Documentation: https://docs.pysquirrels.com

Source Code: https://github.com/squirrels-analytics/squirrels

Table of Contents

Main Features

Here are a few of the things that Squirrels can do:

  • Connect to any database by specifying its SQLAlchemy url (in squirrels.yml) or by using its native connector library in python (in connections.py).
  • Configure API routes for datasets (in squirrels.yml) without writing code.
  • Configure parameter widgets (types include single-select, multi-select, date, number, etc.) for your datasets (in parameters.py).
  • Use SQL templates (templated with Jinja, like dbt) or python functions (that return a Python dataframe in polars or pandas) to define dynamic query logic based on parameter selections.
  • Query multiple databases and join the results together in a final view in one API endpoint/dataset!
  • Test your API endpoints with Squirrels Studio or by a command line that generates rendered sql queries and results as files (for a given set of parameter selections).
  • Define User model (in user.py) and authorize privacy scope per dataset (in squirrels.yml). The user's attributes can even be used in your query logic!
  • Serve dataset metadata and results to AI agents via MCP (Model Context Protocol)

Quick Start

In a new virtual environment, install squirrels. Then, in your project directory, activate the virtual environment and run the following commands:

sqrl new --use-defaults --curr-dir
sqrl build

To run the API server, simply run:

sqrl run

License

Squirrels is released under the Apache 2.0 license.

See the file LICENSE for more details.

Contributing to Squirrels

The sections below describe how to set up your local environment for Squirrels development and run unit tests. A high level overview of the project structure is also provided.

Setup

This project requires the python package manager uv with Python 3.10 or above. Information on setting up uv can be found at: https://docs.astral.sh/uv/getting-started/installation/.

Then, to install all dependencies in a virtual environment, run:

uv sync -p 3.10

And activate the virtual environment with:

source .venv/bin/activate

To confirm that the setup worked, run the following to show the help page for all Squirrels CLI commands:

sqrl -h

Project Structure

From the root of the git repo, the source code can be found in the squirrels folder and unit tests can be found in the tests folder.

The documentation contents are in the docs/ folder and are built with Mintlify.

To understand what a specific Squirrels command is doing, start from the _command_line.py file as your entry point.

The library version is maintained in both the pyproject.toml and the squirrels/_version.py files.

Testing

Run uv run pytest. Or if you have the virtual environment activated, simply run pytest.

Documentation

Install the Mintlify CLI to preview your documentation changes locally. To install, use the following command:

npm i -g mint

Run the following command in the docs/ folder, where the docs.json is located:

mint dev

View your local preview at http://localhost:3000.

Release files for squirrels 0.6.0.post0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for squirrels 0.6.0.post0
File Size Uploaded
squirrels-0.6.0.post0.tar.gz 178.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for squirrels 0.6.0.post0
File Interpreter ABI Platform
squirrels-0.6.0.post0-py3-none-any.whl Python 3 none any Details

Total release size: 394.5 kB

Release files / squirrels-0.6.0.post0.tar.gz

Download URL squirrels-0.6.0.post0.tar.gz
Size 178.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1c803290f5068f81eac89f30a87d50882532525f3521a3d0722202a9ee1fa5d1
BLAKE2b-256 checksum
How to use checksums
b884306b7287b43a9638735d53e725f9938f1748456560e24d1bcf06fa992e21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / squirrels-0.6.0.post0-py3-none-any.whl

Download URL squirrels-0.6.0.post0-py3-none-any.whl
Size 215.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45fcf99526a311d4b73e3f549992f110fbfd24a940d72aa5070f4015935f1811
BLAKE2b-256 checksum
How to use checksums
be69489b3c82d21de0a7e04f1a42b8162514c03aae9b39d9f11bc0c29e765c01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page