No project description provided
Project description
quak /kwæk/
an anywidget for data that talks like a duck
quak is a scalable data profiler for quickly scanning large tables, capturing interactions as executable SQL queries.
- interactive 🖱️ mouse over column summaries, cross-filter, sort, and slice rows.
- fast ⚡ built with Mosaic; views are expressed as SQL queries lazily executed by DuckDB.
- flexible 🔄 supports many data types and formats via Apache Arrow and the dataframe interchange protocol.
- reproducible 📓 a UI for building complex SQL queries; materialize views in the kernel for further analysis.
install
[!WARNING] quak is a prototype exploring a high-performance data profiler based on anywidget. It is not production-ready. Expect bugs. Open-sourced for SciPy 2024.
pip install quak
usage
The easiest way to get started with quak is using the IPython cell magic.
%load_ext quak
import polars as pl
df = pl.read_parquet("https://github.com/uwdata/mosaic/raw/main/data/athletes.parquet")
df
quak hooks into Jupyter's display mechanism to automatically render any
dataframe-like object (implementing the Python dataframe interchange
protocol)
using quak.Widget
instead of the default display.
Alternatively, you can use quak.Widget
directly:
import polars as pl
import quak
df = pl.read_parquet("https://github.com/uwdata/mosaic/raw/main/data/athletes.parquet")
widget = quak.Widget(df)
widget
interacting with the data
quak captures all user interactions as queries.
At any point, table state can be accessed as SQL,
widget.sql # SELECT * FROM df WHERE ...
which for convenience can be executed in the kernel to materialize the view for further analysis:
widget.data() # returns duckdb.DuckDBPyRelation object
By representing UI state as SQL, quak makes it easy to generate complex queries via interactions that would be challenging to write manually, while keeping them reproducible.
using quak in marimo
quak can also be used in marimo notebooks, which provide out-of-the-box support for anywidget:
import marimo as mo
import polars as pl
import quak
df = pl.read_parquet("https://github.com/uwdata/mosaic/raw/main/data/athletes.parquet")
widget = mo.ui.anywidget(quak.Widget(df))
widget
contributing
Contributors welcome! Check the Contributors Guide to get started. Note: I'm wrapping up my PhD, so I might be slow to respond. Please open an issue before contributing a new feature.
references
quak pieces together many important ideas from the web and Python data science ecosystems. It serves as an example of what you can achieve by embracing these platforms for their strengths.
- Observable's data table: Inspiration for the UI design and user interactions.
- Mosaic: The foundation for linking databases and interactive table views.
- Apache Arrow: Support for various data types and efficient data interchange between JS/Python.
- DuckDB: An amazingly engineered piece of software that makes SQL go vroom.
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 quak-0.1.5.tar.gz
.
File metadata
- Download URL: quak-0.1.5.tar.gz
- Upload date:
- Size: 64.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 492dd1508b011f7b7fd2bd853a57089fb4ce2b4dc85b5cfbab49530cbf94590f |
|
MD5 | d9ec86ee3813e748e82694f6534ec649 |
|
BLAKE2b-256 | 33cff108bff9b633eb8d7d518b7f694ba46250ea13cdf2ca846689d99859c553 |
File details
Details for the file quak-0.1.5-py2.py3-none-any.whl
.
File metadata
- Download URL: quak-0.1.5-py2.py3-none-any.whl
- Upload date:
- Size: 65.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72bce3bca7ebf0fdedd60a61504f8c66ce285a09cbab8d9af880093162ce9121 |
|
MD5 | c7bc171d8a84c3246e8c56e0b3118b8e |
|
BLAKE2b-256 | c60860ec119c386769b1b05894433a4be08f4faac7876ab2c6b531ed52f96ca1 |