Skip to main content

Airphin is a tool for converting Airflow DAGs to DolphinScheduler Python API.

Project description

Airphin

PyPi Version PyPi Python Versions PyPi License PyPi Status Downloads Coverage Status Code style: black Imports: isort CI Documentation Status

Airphin is a tool for converting Airflow DAGs to DolphinScheduler Python API.

Installation

For now, it just for test and without publish to pypi but will be adding in the future. You could still install locally by yourself.

python -m pip install --upgrade airphin

Quick Start

Here will give a quick example to show how to convert base on standard input.

# Quick test the convert rule for standard input
# Can also add option `--diff` to see the diff detail of this convert
airphin test "from airflow.operators.bash import BashOperator

test = BashOperator(
    task_id='test',
    bash_command='echo 1',
)
"

And you will see the converted result in the standard output. Airphin can only convert standard input, it can also convert file, directory and even can use in your python code. For more detail, please see our usage.

Documentation

The documentation host on read the doc and is available at https://airphin.readthedocs.io.

Support Statement

For now, we support following conversion from Airflow's DAG files

DAG

Before Conversion After Conversion
from airflow import DAG from pydolphinscheduler.core.process_definition import ProcessDefinition
with DAG(...) as dag: pass with ProcessDefinition(...) as dag: pass

Operators

Dummy Operator

Before Conversion After Conversion
from airflow.operators.dummy_operator import DummyOperator from pydolphinscheduler.tasks.shell import Shell
from airflow.operators.dummy import DummyOperator from pydolphinscheduler.tasks.shell import Shell
dummy = DummyOperator(...) dummy = Shell(..., command="echo 'airflow dummy operator'")

Shell Operator

Before Conversion After Conversion
from airflow.operators.bash import BashOperator from pydolphinscheduler.tasks.shell import Shell
bash = BashOperator(...) bash = Shell(...)

Spark Sql Operator

Before Conversion After Conversion
from airflow.operators.spark_sql_operator import SparkSqlOperator from pydolphinscheduler.tasks.sql import Sql
spark = SparkSqlOperator(...) spark = Sql(...)

Python Operator

Before Conversion After Conversion
from airflow.operators.python_operator import PythonOperator from pydolphinscheduler.tasks.python import Python
python = PythonOperator(...) python = Python(...)

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

airphin-0.0.7.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

airphin-0.0.7-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file airphin-0.0.7.tar.gz.

File metadata

  • Download URL: airphin-0.0.7.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for airphin-0.0.7.tar.gz
Algorithm Hash digest
SHA256 b3fbdf0a037086cb13451a951042bc16961a34d7fabf6f4a314b28813219a363
MD5 dcc34b25c7c6fad2397e979acb21ba6e
BLAKE2b-256 b1c8d77a2aa72aa556c6c8d63b28db87f8d21a2f6edafc9d2b9c81d1151b8570

See more details on using hashes here.

File details

Details for the file airphin-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: airphin-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for airphin-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 cf93bb026adcea5beb6f1d73bd694b2630dc10d5622f4a83b9224bb147bb49c6
MD5 984f3e2dc3311234f7da2dcf38040b09
BLAKE2b-256 1767a66beb21a80f6401f327f9069133da15220c659757bfc1e5b379ba88c00b

See more details on using hashes here.

Supported by

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