Notebook execution utilities for Zipline AI
Project description
zipline-pyspark
Execution utilities to help with iteration and UX when working with Zipline in notebook environments.
Status: Work in progress.
Overview
zipline-pyspark provides thin wrappers around Zipline's core entities — GroupBy, Join, and StagingQuery — that are designed to run interactively inside a Jupyter (or compatible) notebook against a live PySpark session. The goal is to make it easy to prototype, debug, and iterate on Zipline feature definitions without leaving the notebook.
Installation
%pip install zipline-pyspark
Usage
from ai.chronon.pyspark.jupyter import JupyterGroupBy, JupyterJoin, JupyterStagingQuery
# Run a GroupBy over a date range, chunked by day
result_df = JupyterGroupBy(my_group_by, spark).run(
start_date="2026-04-01",
end_date="2026-04-07",
step_days=1,
)
# Run a Join
result_df = JupyterJoin(my_join, spark).run(
start_date="2026-04-01",
end_date="2026-04-07",
)
# Run a StagingQuery
result_df = JupyterStagingQuery(my_staging_query, spark).run(
end_date="2026-04-07",
start_date="2026-04-01",
step_days=1,
)
Setup
Prerequisites
- Python 3.11+
- PySpark 3.5+
- A running Spark session (local or remote)
zipline-aipackage (installed automatically as a dependency)
Databricks limitations
The Databricks notebook executors invoke Chronon's Scala batch driver through the Spark
driver JVM. Databricks serverless compute does not support direct access to the underlying
driver JVM via sparkContext, so these executors are not compatible with serverless
notebook compute. Use classic Databricks compute with Dedicated access mode, and attach the
Chronon batch JAR to the cluster.
Development install
git clone https://github.com/zipline-ai/zipline-pyspark.git
cd zipline-pyspark
pip install -e ".[dev]"
pre-commit install
Running tests
pytest tests/ -v
Coverage is enforced automatically (configured in pyproject.toml). To skip the coverage check locally:
pytest tests/ -v --no-cov
Release Flow
Each PR must carry exactly one semantic version label: Semver-Major, Semver-Minor, or
Semver-Patch. Release Drafter uses those labels to keep a draft GitHub release up to date
and determine the next release version.
Publishing that GitHub release builds the zipline-pyspark wheel with the release tag as
the package version and publishes it to PyPI through trusted publishing. To smoke-test the
same wheel build locally:
scripts/build_release_wheel.sh v0.2.0
Roadmap
1. Implement jupyter and databricks backends
jupyter.py— completeJupyterGroupByandJupyterJointo match the existingJupyterStagingQuerypattern: date-range chunking, setup-statement execution, and union of per-step DataFrames.databricks.py— a parallel set of classes (DatabricksGroupBy,DatabricksJoin,DatabricksStagingQuery) that adapt the same interface for Databricks notebooks:dbutils-aware progress display, widget-based date inputs, and DatabricksdisplayHTML/displayintegration instead of plain DataFrame returns.- Shared base layer — extract common chunking and template-rendering logic into an internal
_base.pyso both backends stay in sync without code duplication.
2. Distribution
- Publish to PyPI under
zipline-pysparkand document the%pip install zipline-pysparknotebook workflow.
Credits
This project is the Zipline counterpart of the original implementation contributed to the open-source Chronon project by Airbnb. See the original pull request for reference: airbnb/chronon#981.
License
See LICENSE.
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 Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zipline_pyspark-0.1.1-py3-none-any.whl.
File metadata
- Download URL: zipline_pyspark-0.1.1-py3-none-any.whl
- Upload date:
- Size: 23.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d9795a16652be6e78ba92496c4b3274c47355236436fcb3887e59f95091ac43
|
|
| MD5 |
e6e013ae56bbb8fc72ce4d4fc3139615
|
|
| BLAKE2b-256 |
386eca1539508b7ba0d793bfe05acd8c6579964d5b169396b60be80001ceb2e9
|
Provenance
The following attestation bundles were made for zipline_pyspark-0.1.1-py3-none-any.whl:
Publisher:
publish_release.yml on zipline-ai/zipline-pyspark
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zipline_pyspark-0.1.1-py3-none-any.whl -
Subject digest:
6d9795a16652be6e78ba92496c4b3274c47355236436fcb3887e59f95091ac43 - Sigstore transparency entry: 1510660912
- Sigstore integration time:
-
Permalink:
zipline-ai/zipline-pyspark@227cc1b6938d004a1a7af7ecb7023536705e9429 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/zipline-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_release.yml@227cc1b6938d004a1a7af7ecb7023536705e9429 -
Trigger Event:
release
-
Statement type: