Skip to main content

Fast task runner for Python projects

Project description

⚡ Zetten

The High-Performance Task Runner for Python Backends. Parallel. Deterministic. Fast.

PyPI - Version PyPI - License PyPI - Python Version CI Status

Zetten is a dependency-aware execution engine designed to unify how you run tests, linters, and builds. It ensures that your workflow remains identical across local development environments and any CI platform, only faster.


🚀 The Zetten Philosophy

Modern Python projects often require coordinating various tools (tests, type-checkers, formatters). Zetten eliminates "Glue Code Fatigue" by providing:

  • Parallel Execution: Automatically identifies independent tasks and runs them concurrently across your CPU cores.
  • Three-Tier Variable: System: Advanced command templating with a strict priority hierarchy: CLI Flags (-k) > Config Vars > Environment Variables.
  • Smart Caching: Uses content-addressable hashing to skip tasks if their specific inputs haven't changed since the last run.
  • Platform Agnostic: Behaves identically on macOS, Windows, Linux, or any CI/CD provider.
  • Dependency Awareness: Define a Directed Acyclic Graph (DAG) of tasks to ensure correct execution order (e.g., setup always precedes test).

✨ Features

  • ⚡ Worker Pool Concurrency: Maximizes resource usage by running non-dependent tasks in parallel.
  • 🏷️ CI Tagging: Execute logical groups of tasks (e.g., run --tag ci) with a single command.
  • 🛡️ Failure Propagation: If a foundational task fails, Zetten halts downstream execution to prevent cascading errors.
  • 🔍 Intelligent Diagnostics: Includes zetten doctor to identify environment inconsistencies instantly.
  • ⏱️ Performance Analytics: (Coming Soon) Real-time insights into time saved via parallelism.

🛠️ Quick Start

Install Zetten:

pip install zetten

Initiate a project:

ztn init

For Python script execution:

[tool.zetten.tasks.hello]
script = "my_module:main"  # Runs: python -c "import my_module; my_module.main()"
description = "Run a python function"

Define tasks in pyproject.toml:

[tool.zetten.tasks.lint]
cmd = "ruff check src"
inputs = ["src/"]
tags = ["ci"]

[tool.zetten.tasks.test]
cmd = "pytest"
depends_on = ["lint"]
inputs = ["src/", "tests/"]
tags = ["ci"]

[tool.zetten.tasks.build]
description = "Build the project"
# Supports Fallback Syntax: ${VAR:-default}
cmd = "mkdir -p ${build_dir} && python -m build --outdir ${DEST:-dist}"
depends_on = ["lint"]
inputs = ["src/"]

Define tasks in zetten.toml:

[tasks.setup]
cmd = "pip install -r requirements.txt"

[tasks.lint]
cmd = "ruff check src"
inputs = ["src/"]
tags = ["ci"]

[tasks.test]
cmd = "pytest"
depends_on = ["setup"]
inputs = ["src/", "tests/"]
tags = ["ci"]

Run tasks:

ztn run test
ztn run lint test

Zetten will only re-run tasks when their inputs change.


⚙️ The Variable Hierarchy

Zetten uses a deterministic three-tier system to resolve variables:

  • Tier 1 (CLI): ztn run build -k build_dir=output (Highest Priority)
  • Tier 2 (Config): Values defined in [tool.zetten.vars]
  • Tier 3 (Env): System environment variables (e.g., $USER, $PATH)

🚀 Running in CI

Zetten is designed for the modern CI/CD pipeline. By using Tags and Strict Mode, you can ensure your pipeline is both flexible and safe.

# Force a specific version and environment in CI
ztn run --tag ci -k VERSION=${GITHUB_SHA} -k ENV=prod

If a foundational task fails, Zetten halts downstream execution immediately to save CI minutes and prevent cascading failures.

⚙️ Configuration Model

Configuration is explicit by design:

  • No templating
  • No conditionals
  • No implicit behavior

Configuration lives in:

  • pyproject.toml (preferred)
  • zetten.toml (for legacy or minimal projects)

If no configuration is found, Zetten will explain how to resolve the issue.


🛠 Commands

🛠 Commands

  • ztn run — Execute tasks with parallel dependency resolution.
  • ztn run -k KEY=VAL — Override any variable via the CLI.
  • ztn watch — Precision re-runs on input changes.
  • ztn graph — Visualizes the Directed Acyclic Graph (DAG) of your tasks.
  • ztn doctor — Diagnoses configuration and environmental health issues.
  • ztn init — Interactive project setup and template generation.

🛡 Status

Zetten is currently in v0.1. If no configuration file is found, Zetten will provide clear instructions on how to initialize your project.


Documentation

Full documentation is available at: Github Wiki


🤝 Contributing

We love Rust and Python! If you want to help make Zetten even faster:

  • Fork the repo.
  • Add your feature (don't forget the tests!).
  • Open a Pull Request.

Built with ❤️ for the Python community using the speed of Rust.

Please open an issue or discussion on GitHub before proposing large changes.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

zetten-1.0.14-py3-none-win_amd64.whl (1.7 MB view details)

Uploaded Python 3Windows x86-64

zetten-1.0.14-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.7 MB view details)

Uploaded Python 3manylinux: glibc 2.5+ x86-64

zetten-1.0.14-py3-none-macosx_11_0_x86_64.whl (1.6 MB view details)

Uploaded Python 3macOS 11.0+ x86-64

zetten-1.0.14-py3-none-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file zetten-1.0.14-py3-none-win_amd64.whl.

File metadata

  • Download URL: zetten-1.0.14-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for zetten-1.0.14-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 e7cabe844fae5779b483ba8380c5dce8dd109c946e91a718bda6ef196dcc25e2
MD5 c09d44c83183e73ef35e69f802901eea
BLAKE2b-256 7575b544657cd699e7c04ff4f6fde2877cdc612e1168623017d8061af50cb9fb

See more details on using hashes here.

File details

Details for the file zetten-1.0.14-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for zetten-1.0.14-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a443a13878d23dedb38616252b54950020eaefc1ba4d341b65410c8b5e9624d2
MD5 fc3e1ba103142aea2ebae026ab45c076
BLAKE2b-256 a47fc22db8bd4951576b18c617150079db545bd45b7c5d4e50ea71182b8e4c9b

See more details on using hashes here.

File details

Details for the file zetten-1.0.14-py3-none-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for zetten-1.0.14-py3-none-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 5c4228e035a2d4cfd1dbc7972bc0d41a845db421fc421430dcd982a6df9ea899
MD5 975a2586f32035cf3d877777df75bb1e
BLAKE2b-256 9b10c2230e11a236f5209668f417ca0d4e73e0ad2d4086e69b1e209e68d4a46b

See more details on using hashes here.

File details

Details for the file zetten-1.0.14-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for zetten-1.0.14-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 532de271831f41393ad793351de4b6d37fe574a01d695f4f578dd50bf9cfdbdc
MD5 2c942c77e77d4e57f460831c527062b3
BLAKE2b-256 8dea0e639a2cb8ec60e4667c84d3e8db9354c96a8fddbf7d82eafbceaa2e73d2

See more details on using hashes here.

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