Metadata-Version: 2.4
Name: awpl-loader
Version: 0.3.0rc8
Summary: AWPL Loader for Airflow for use with awpl-loader.py stub
Author: Julian Jaeger
Author-email: julian.jaeger@student.uibk.ac.at
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: apache-airflow-providers-cncf-kubernetes
Requires-Dist: jsonschema
Requires-Dist: pyyaml
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# `awpl-loader` for Airflow

This directory contains the `awpl-loader` package for Airflow. AWPL files (`.awpl`) placed in `/path/to/airflow/dags/awpl/` are parsed and available to execute from within Airflow.

The package includes `awpl_stub.py`, an Airflow DAG stub that discovers and loads `.awpl` files automatically.

## Docker Installation

Refer to `docker/`.

## Installation

```bash
pip install awpl-loader
```

Then, extract the bundled stub to Airflow's `dags/` directory:

```bash
cp $(python -c "import awpl_loader;print(awpl_loader.__path__[0])")/awpl_stub.py /path/to/airflow/dags/
```

Airflow will automatically load `.awpl` files from the `dags/awpl/` subdirectory in the next refresh cycle (by default, every ~30s).

## Installation from source

To install from source (e.g., for development), clone the repository and install the library.

```bash
git clone https://github.com/Spice-uibk/awpl-converter.git
cd awpl-converter/awpl-loader/lib
pip install setuptools wheel
python3 -m build
pip install dist/awpl_loader-<version>-py3-none-any.whl
```

Then extract the stub to Airflow's `dags/` directory:

```bash
cp $(python -c "import awpl_loader;print(awpl_loader.__path__[0])")/awpl_stub.py /path/to/airflow/dags/
```

## Publishing

The package is published to [PyPI](https://pypi.org/project/awpl-loader/) automatically via GitHub Actions when a new release is created:

```bash
git tag v0.2.0
git push --tags
# Then create a GitHub release. Actions will publish to PyPI
```

## Loader log/errors

Loader logs are shown in Airflow's default logging field on the webinterface. Currently, if a DAG contains an error the loader will raise an Exception to trigger the error display in Airflow (Error dialog box). This, however, causes all other (potentially valid) dags to be discarded and not loaded until the invalid dag is removed/fixed.
