Analytical SQL Cell
For the last decade, the data ecosystem has mainly focused on the technologies to store and process big datasets — the bigger the better. Later on, Modern Data Stack emerged as a cloud-native suite of products used for data integration and data analytics by the more technology-forward companies. Data warehouses are now a default piece of the Modern Data Stack and Snowflake’s rapid rise has been the poster child of this trend.
But in real life, most analytical workloads aren’t massive. Users prefer easy and fast answers to their questions instead of waiting for the cloud to spin. Instead of a distributed database in the cloud, most analyses can be handled with an optimized engine on our laptop and the cloud can be leveraged when needed.
To fill the gap, we built Analytical SQL Cell, a free and open-source Jupyter Widget that offers a Personal Data Lake experience for Jupyter Notebook users.
Analytical SQL has the following features:
- Pain-free setup (pip install asqlcell and you are in).
- Unleash the power of SQL for analytical workloads.
- Lightning speed for data loading.
- Built-in visualization.
- Low footprint for analytical processing.
- Interleave Python and SQL programming.
- Free and open source.
Installation
You can install using pip:
pip install asqlcell
Quick Start
Here's a quick example to get you started with Analytical SQL Cell in Jupyter:
%%sql
SELECT
continent,
AVG(life_exp) AS health,
AVG(gdp_cap) AS wealth,
SUM(population) AS population
FROM 'gapminder.csv.gz'
WHERE year=2007
GROUP BY continent
In the above sample, %%sql is a cell magic indicating that the cell block will be executed as a SQL statement. File are used as data source for querying with SQL.
Data Load
You can query from Pandas DataFrame, CSV files, compressed (e.g. compressed with gzip) CSV files, as well as Parquet files.
SQL
DuckDB is the default engine of Analytical SQL Cell. Please find more details at the SQL Introduction of DuckDB.
Result Table
With the SQL query being executed in an Analytical SQL Cell, the result set is presented as a table.
Chart Builder
You can further visualize the result set by clicking the Chart tab.
Here are the chart types supported:
- Column chart
- Bar chart
- Line chart
- Area chart
- Scatter chart
- Pie chart
- Combo chart
- Funnel chart
- Sunburst chart
Tutorial
- Introduction
- World Development in Numbers
- Visualise Netflix Data With Analytical SQL
- Learn SQL with Jupyter Lab
- Business Questions on Chinook Music Store
- Use the Right Chart for Data Visualization
Development
This widget is developed with conda to ensure a consistent developer experience. The project is developed in both Mac OS and Windows Subsystem for Linux.
Please run the following commands to create a conda environment:
conda create -n asqlcell -c conda-forge nodejs=18.15 python=3.8 jupyterlab=3.6 jupyter_packaging=0.12
conda activate asqlcell
Python
Install the python. This will also build the TypeScript package.
pip install -e ".[test, examples, docs]"
Jupyter
When developing your extensions, you need to manually enable your extensions with the notebook / lab frontend.
For lab, this is done by the command:
jupyter labextension develop --overwrite .
jlpm run build
Typescript
You must start watching the change of the widget:
jlpm run watch
Then in another terminal you can run Jupyter Lab (without launching a browser):
jupyter lab --no-browser
Now you can open Google Chrome and navigate to http://localhost:8888 to play with the widget. After a change wait for the build to finish and then refresh your browser and the changes should take effect.
If you make a change to the python code then you will need to restart the notebook kernel to have it take effect.
Metadata
Release files for asqlcell 0.3.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asqlcell-0.3.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for asqlcell-0.3.1.0-py2.py3-none-any.whl |
Release files / asqlcell-0.3.1.0-py2.py3-none-any.whl
| Download URL | asqlcell-0.3.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 8.0 MB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7710b83b5a0c520cd5f7d3356d76c7465cc4fbba3f2fb771be1ef4c8399c65c1
|
|
BLAKE2b-256 checksum How to use checksums |
a316a5e1d8e88f01c836e5cb639c6f785a5e1fa8020e26706c4c2a5d845c4a40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.17
|
Security for asqlcell 0.3.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.