Metadata-Version: 2.5
Name: apache-airflow-providers-pixi
Version: 0.0.1
Import-Name: airflow.providers.pixi
Import-Namespace: airflow
Import-Namespace: airflow.providers
Summary: Apache Airflow 3 provider to run Python callables in Pixi environments (PixiOperator and @task.pixi).
Project-URL: Documentation, https://danplischke.github.io/apache-airflow-providers-pixi/
Project-URL: Source Code, https://github.com/danplischke/apache-airflow-providers-pixi
Project-URL: Bug Tracker, https://github.com/danplischke/apache-airflow-providers-pixi/issues
Author: Dan Plischke
License-Expression: MIT
License-File: LICENSE
Keywords: airflow,airflow-provider,conda,integration,pixi
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Apache Airflow
Classifier: Framework :: Apache Airflow :: Provider
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: !=3.15,>=3.10
Requires-Dist: apache-airflow-providers-standard>=1.9.1
Requires-Dist: apache-airflow>=3.1.2
Requires-Dist: packaging>=22
Requires-Dist: tomlkit>=0.12
Provides-Extra: cncf-kubernetes
Requires-Dist: apache-airflow-providers-cncf-kubernetes>=10.9.0; extra == 'cncf-kubernetes'
Description-Content-Type: text/markdown

# apache-airflow-providers-pixi

An Apache Airflow 3 provider that runs tasks inside [Pixi](https://pixi.sh)-managed environments,
on the worker or in a Kubernetes pod, so a task can use conda-forge and PyPI packages that are not
installed on the worker.

Documentation: https://danplischke.github.io/apache-airflow-providers-pixi/
(for LLMs and coding agents: [llms.txt](https://danplischke.github.io/apache-airflow-providers-pixi/llms.txt))

## Installation

```bash
pip install apache-airflow-providers-pixi
pip install "apache-airflow-providers-pixi[cncf.kubernetes]"  # adds PixiKubernetesPodOperator
```

Requires Apache Airflow 3.1.2 or newer and Python 3.10 to 3.14 (3.14 needs Airflow 3.2). The
workers need [pixi](https://pixi.sh/latest/installation/) 0.81.0 or newer on `PATH`; the provider
never installs it. See [Requirements](https://danplischke.github.io/apache-airflow-providers-pixi/#requirements)
and the [deployment guide](https://danplischke.github.io/apache-airflow-providers-pixi/deployment/).

## Quick start

```python
from airflow.sdk import dag, task


@dag
def my_dag():
    @task.pixi(dependencies={"python": "3.12.*"}, pypi_dependencies=["pandas>=2"])
    def summarize(n: int) -> float:
        import pandas as pd  # imports go inside the function: it runs in the Pixi environment

        return float(pd.Series(range(n)).mean())

    summarize(3)


my_dag()
```

Pass `pixi_project_path` or `pixi_toml_path` instead to use an existing Pixi project. The
[Pixi Operator](https://danplischke.github.io/apache-airflow-providers-pixi/operators/pixi/) guide
covers the ways to choose an environment, arguments and return values, the Airflow context,
environment variables, errors, timeouts and caches.

## Operators, decorators and sensor

| Class / decorator | What it does |
|---|---|
| [`PixiOperator`](https://danplischke.github.io/apache-airflow-providers-pixi/operators/pixi/) / [`@task.pixi`](https://danplischke.github.io/apache-airflow-providers-pixi/decorators/pixi/) | runs a Python callable in a Pixi environment on the worker |
| [`PixiBashOperator`](https://danplischke.github.io/apache-airflow-providers-pixi/operators/bash/) / `@task.pixi_bash` | runs a Bash command in a Pixi environment |
| [`PixiTaskOperator`](https://danplischke.github.io/apache-airflow-providers-pixi/operators/task/) | runs a task from the manifest's `[tasks]` |
| [`PixiKubernetesPodOperator`](https://danplischke.github.io/apache-airflow-providers-pixi/operators/kubernetes/) / `@task.pixi_kubernetes` | runs a Python callable in a Pixi environment in a Kubernetes pod |
| [`PixiBranchOperator`](https://danplischke.github.io/apache-airflow-providers-pixi/operators/branch/) / `@task.pixi_branch` | chooses the downstream tasks to follow |
| [`PixiShortCircuitOperator`](https://danplischke.github.io/apache-airflow-providers-pixi/operators/branch/#short-circuit) / `@task.pixi_short_circuit` | skips downstream tasks when the callable returns a falsy value |
| [`PixiSensor`](https://danplischke.github.io/apache-airflow-providers-pixi/sensors/pixi/) / `@task.pixi_sensor` | waits until the callable returns a truthy value |

Credentials for private conda channels and PyPI indexes go in a
[`pixi` connection](https://danplischke.github.io/apache-airflow-providers-pixi/connections/pixi/).
Other providers can build on these operators; see
[Building on the Pixi Operator](https://danplischke.github.io/apache-airflow-providers-pixi/extending/).

## Development

With [uv](https://docs.astral.sh/uv/), [just](https://just.systems) and pixi installed:

- `just dev` installs the package with the dev and docs groups and the pre-commit hooks.
- `just test` runs the unit tests, with a fake pixi.
- `just check` runs what CI runs: lint, unit tests, docs build, package build and smoke test.
- `just standalone` starts a local Airflow at http://localhost:8080 with the DAGs in `dev/dags`.

`just` lists the other recipes. Integration, system and compatibility tests are described in
[System Tests](https://danplischke.github.io/apache-airflow-providers-pixi/system-tests/) and
[Installing from sources](https://danplischke.github.io/apache-airflow-providers-pixi/installing-from-sources/).

## License

MIT
