Skip to main content

No project description provided

Project description

quak logo
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, the dataframe interchange protocol, and the Arrow PyCapsule Interface.
  • reproducible 📓 a UI for building complex SQL queries; materialize views in the kernel for further analysis.

install

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
olympic athletes table

quak hooks into Jupyter's display mechanism to automatically render any dataframe-like object (implementing the Python dataframe interchange protocol or Arrow PyCapsule Interface) 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quak-0.3.5.tar.gz (180.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quak-0.3.5-py3-none-any.whl (181.0 kB view details)

Uploaded Python 3

File details

Details for the file quak-0.3.5.tar.gz.

File metadata

  • Download URL: quak-0.3.5.tar.gz
  • Upload date:
  • Size: 180.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quak-0.3.5.tar.gz
Algorithm Hash digest
SHA256 94e43c69cc62c816a71a6472249052c34d22d34472681ebaa6a3da7a326d645c
MD5 b20b60fa51088563b12db637b6016934
BLAKE2b-256 5b0c596e4be14fc18e8b16ac2bcb50dfb65baeb0ff41618af2dd86fde3a3f2d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for quak-0.3.5.tar.gz:

Publisher: release.yml on manzt/quak

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quak-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: quak-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 181.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quak-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5ca6b7775852d836e86d0ea540dbb527506e92b5ce7f0709896dd12bc3ff50e8
MD5 efcb904ff65ae6464ef99c3cec87915c
BLAKE2b-256 8d58ee82872c4c21199bf625ff3cb2a6ce9e9af8fb5d8ce3fc838a4611479072

See more details on using hashes here.

Provenance

The following attestation bundles were made for quak-0.3.5-py3-none-any.whl:

Publisher: release.yml on manzt/quak

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page