Squirrels - API Framework for Data Analytics
Project description
Squirrels
Squirrels is an API framework that lets you create REST APIs for dynamic data analytics!
Documentation: https://squirrels-analytics.github.io/
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 (inconnections.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 Jinja SQL templates (just like dbt!) or python functions (that return a pandas dataframe) 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 an interactive UI or by a command line that generates rendered sql queries and results (for a given set of parameter selections).
- Define authentication logic (in
auth.py
) and authorize privacy scope per dataset (insquirrels.yml
). The user's attributes can even be used in your query logic!
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 python version 3.10 or above to be installed. It also uses the python build tool poetry
. Information on setting up poetry can be found at: https://python-poetry.org/docs/.
Then, to install all dependencies, run:
poetry install
And activate the virtual environment created by poetry with:
poetry shell
To confirm that the setup worked, run the following to show the help page for all squirrels CLI commands:
sqrl -h
You can enter exit
to exit the virtual environment shell. You can also run poetry run sqrl -h
to run squirrels commands without activating the virtual environment.
Testing
In poetry's virtual environment, run pytest
.
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.
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.
When a user initializes a squirrels project using sqrl init
, the files are copied from the squirrels/package_data/base_project
folder. The contents in the database
subfolder were constructed from the scripts in the database_elt
folder.
For the Squirrels UI activated by sqrl run
, the HTML, CSS, and Javascript files can be found in the static
and templates
subfolders of squirrels/package_data
. The CSS and Javascript files are minified and built from the source files in this project: https://github.com/squirrels-analytics/squirrels-testing-ui.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file squirrels-0.4.0.tar.gz
.
File metadata
- Download URL: squirrels-0.4.0.tar.gz
- Upload date:
- Size: 251.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.0 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1733f7564914aad5521dba08c56b45d76b02fecebd597f8be67a22c206494102 |
|
MD5 | 2eaac1e14eeb764e74e0222a5d21dd59 |
|
BLAKE2b-256 | 97ad04cabad529815f4607b6c5555dd21398843d51ce34c471cc24e32d59d84a |
File details
Details for the file squirrels-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: squirrels-0.4.0-py3-none-any.whl
- Upload date:
- Size: 266.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.0 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc43a6552f3461565721f44ade98ce2e5c8f2790759bb30419165673d0f922aa |
|
MD5 | d61b974dcb7368b12377370a40ec6212 |
|
BLAKE2b-256 | bf609c404de71ec118a0b60b44837fbc76b17e4d85e50f091f69c37ebb92f6e7 |