# Air2phin
[![PyPi Version](https://img.shields.io/pypi/v/air2phin.svg?style=flat-square&logo=PyPi)](https://pypi.org/project/air2phin/)
[![PyPi Python Versions](https://img.shields.io/pypi/pyversions/air2phin.svg?style=flat-square&logo=python)](https://pypi.org/project/air2phin/)
[![PyPi License](https://img.shields.io/:license-Apache%202-blue.svg?style=flat-square)](https://raw.githubusercontent.com/WhaleOps/air2phin/main/LICENSE)
[![PyPi Status](https://img.shields.io/pypi/status/air2phin.svg?style=flat-square)](https://pypi.org/project/air2phin/)
[![Downloads](https://pepy.tech/badge/air2phin/month)](https://pepy.tech/project/air2phin)
[![Coverage Status](https://img.shields.io/codecov/c/github/WhaleOps/air2phin/main.svg?style=flat-square)](https://codecov.io/github/WhaleOps/air2phin?branch=main) <!-- markdown-link-check-disable-line -->
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat-square&labelColor=ef8336)](https://pycqa.github.io/isort)
[![CI](https://github.com/WhaleOps/air2phin/actions/workflows/ci.yaml/badge.svg)](https://github.com/WhaleOps/air2phin/actions/workflows/ci.yaml)
[![Documentation Status](https://readthedocs.org/projects/air2phin/badge/?version=latest)](https://air2phin.readthedocs.io/en/latest/?badge=latest)
air2phin is a tool for migrating 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.
```shell
python -m pip install --upgrade air2phin
```
## Quick Start
Here will give a quick example to show how to migrate base on standard input.
```shell
# Quick test the migrate rule for standard input
# Can also add option `--diff` to see the diff detail of this migrate
air2phin test "from airflow.operators.bash import BashOperator
test = BashOperator(
task_id='test',
bash_command='echo 1',
)
"
```
And you will see the migrated result in the standard output. air2phin can only migrate standard input, it can
also migrate file, directory and even can use in your python code. For more detail, please see [our usage](https://air2phin.readthedocs.io/en/latest/start.html#usage).
## Documentation
The documentation host on read the doc and is available at [https://air2phin.readthedocs.io](https://air2phin.readthedocs.io).
## Support Statement
For now, we support following statement from Airflow's DAG files
### DAG
| Before Migration | After Migration |
|------------------------------|----------------------------------------------------------------------------|
| `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 Migration | After Migration |
|--------------------------------------------------------------|---------------------------------------------------------------|
| `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 Migration | After Migration |
|---------------------------------------------------|----------------------------------------------------|
| `from airflow.operators.bash import BashOperator` | `from pydolphinscheduler.tasks.shell import Shell` |
| `bash = BashOperator(...)` | `bash = Shell(...)` |
#### Spark Sql Operator
| Before Migration | After Migration |
|---------------------------------------------------------------------|------------------------------------------------|
| `from airflow.operators.spark_sql_operator import SparkSqlOperator` | `from pydolphinscheduler.tasks.sql import Sql` |
| `spark = SparkSqlOperator(...)` | `spark = Sql(...)` |
#### Python Operator
| Before Migration | After Migration |
|----------------------------------------------------------------|------------------------------------------------------|
| `from airflow.operators.python_operator import PythonOperator` | `from pydolphinscheduler.tasks.python import Python` |
| `python = PythonOperator(...)` | `python = Python(...)` |
Raw data
{
"_id": null,
"home_page": "https://github.com/WhaleOps/air2phin",
"name": "air2phin",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "all",
"author": "Jay Chung",
"author_email": "zhongjiajie955@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8b/db/ff7b00310354763c3bbee636a3e5ec838a97f635759db7962d9bb415fa4d/air2phin-0.0.21.tar.gz",
"platform": null,
"description": "# Air2phin\n\n[![PyPi Version](https://img.shields.io/pypi/v/air2phin.svg?style=flat-square&logo=PyPi)](https://pypi.org/project/air2phin/)\n[![PyPi Python Versions](https://img.shields.io/pypi/pyversions/air2phin.svg?style=flat-square&logo=python)](https://pypi.org/project/air2phin/)\n[![PyPi License](https://img.shields.io/:license-Apache%202-blue.svg?style=flat-square)](https://raw.githubusercontent.com/WhaleOps/air2phin/main/LICENSE)\n[![PyPi Status](https://img.shields.io/pypi/status/air2phin.svg?style=flat-square)](https://pypi.org/project/air2phin/)\n[![Downloads](https://pepy.tech/badge/air2phin/month)](https://pepy.tech/project/air2phin)\n[![Coverage Status](https://img.shields.io/codecov/c/github/WhaleOps/air2phin/main.svg?style=flat-square)](https://codecov.io/github/WhaleOps/air2phin?branch=main) <!-- markdown-link-check-disable-line -->\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat-square&labelColor=ef8336)](https://pycqa.github.io/isort)\n[![CI](https://github.com/WhaleOps/air2phin/actions/workflows/ci.yaml/badge.svg)](https://github.com/WhaleOps/air2phin/actions/workflows/ci.yaml)\n[![Documentation Status](https://readthedocs.org/projects/air2phin/badge/?version=latest)](https://air2phin.readthedocs.io/en/latest/?badge=latest)\n\nair2phin is a tool for migrating Airflow DAGs to DolphinScheduler Python API.\n\n## Installation\n\nFor now, it just for test and without publish to pypi but will be adding in the future.\nYou could still install locally by yourself.\n\n```shell\npython -m pip install --upgrade air2phin\n```\n\n## Quick Start\n\nHere will give a quick example to show how to migrate base on standard input.\n\n```shell\n# Quick test the migrate rule for standard input\n# Can also add option `--diff` to see the diff detail of this migrate\nair2phin test \"from airflow.operators.bash import BashOperator\n\ntest = BashOperator(\n task_id='test',\n bash_command='echo 1',\n)\n\"\n```\n\nAnd you will see the migrated result in the standard output. air2phin can only migrate standard input, it can\nalso migrate file, directory and even can use in your python code. For more detail, please see [our usage](https://air2phin.readthedocs.io/en/latest/start.html#usage).\n\n## Documentation\n\nThe documentation host on read the doc and is available at [https://air2phin.readthedocs.io](https://air2phin.readthedocs.io).\n\n## Support Statement\n\nFor now, we support following statement from Airflow's DAG files\n\n### DAG\n\n| Before Migration | After Migration |\n|------------------------------|----------------------------------------------------------------------------|\n| `from airflow import DAG` | `from pydolphinscheduler.core.process_definition import ProcessDefinition` |\n| `with DAG(...) as dag: pass` | `with ProcessDefinition(...) as dag: pass` |\n\n### Operators\n\n#### Dummy Operator\n\n| Before Migration | After Migration |\n|--------------------------------------------------------------|---------------------------------------------------------------|\n| `from airflow.operators.dummy_operator import DummyOperator` | `from pydolphinscheduler.tasks.shell import Shell` |\n| `from airflow.operators.dummy import DummyOperator` | `from pydolphinscheduler.tasks.shell import Shell` |\n| `dummy = DummyOperator(...)` | `dummy = Shell(..., command=\"echo 'airflow dummy operator'\")` |\n\n#### Shell Operator\n\n| Before Migration | After Migration |\n|---------------------------------------------------|----------------------------------------------------|\n| `from airflow.operators.bash import BashOperator` | `from pydolphinscheduler.tasks.shell import Shell` |\n| `bash = BashOperator(...)` | `bash = Shell(...)` |\n\n#### Spark Sql Operator\n\n| Before Migration | After Migration |\n|---------------------------------------------------------------------|------------------------------------------------|\n| `from airflow.operators.spark_sql_operator import SparkSqlOperator` | `from pydolphinscheduler.tasks.sql import Sql` |\n| `spark = SparkSqlOperator(...)` | `spark = Sql(...)` |\n\n#### Python Operator\n\n| Before Migration | After Migration |\n|----------------------------------------------------------------|------------------------------------------------------|\n| `from airflow.operators.python_operator import PythonOperator` | `from pydolphinscheduler.tasks.python import Python` |\n| `python = PythonOperator(...)` | `python = Python(...)` |\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Air2phin is a tool for migrating Airflow DAGs to DolphinScheduler Python API.",
"version": "0.0.21",
"project_urls": {
"Changelog": "https://github.com/WhaleOps/air2phin/releases",
"Documentation": "https://air2phin.readthedocs.io",
"Homepage": "https://github.com/WhaleOps/air2phin",
"Issue Tracker": "https://github.com/WhaleOps/air2phin/issues",
"Source": "https://github.com/WhaleOps/air2phin"
},
"split_keywords": [
"all"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2672d6b4b964df4cfd52f70b3b58abd346b3ffb69ba33fd33566acbf4e217c16",
"md5": "f774e00548076ccb6fa63e2d600dcee8",
"sha256": "c9eef39b078e53623669d6f5593d4445e161732748dc9a4ae4b4f7028871dfd6"
},
"downloads": -1,
"filename": "air2phin-0.0.21-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f774e00548076ccb6fa63e2d600dcee8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 31233,
"upload_time": "2023-03-22T04:29:20",
"upload_time_iso_8601": "2023-03-22T04:29:20.491591Z",
"url": "https://files.pythonhosted.org/packages/26/72/d6b4b964df4cfd52f70b3b58abd346b3ffb69ba33fd33566acbf4e217c16/air2phin-0.0.21-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8bdbff7b00310354763c3bbee636a3e5ec838a97f635759db7962d9bb415fa4d",
"md5": "6cb67848ceaedb7257e9fd8138f82c97",
"sha256": "0eda9cbdf2dbc47b82113a93bfeeceeb595e15d16d32c49ddbfeed898cb31570"
},
"downloads": -1,
"filename": "air2phin-0.0.21.tar.gz",
"has_sig": false,
"md5_digest": "6cb67848ceaedb7257e9fd8138f82c97",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 22558,
"upload_time": "2023-03-22T04:29:22",
"upload_time_iso_8601": "2023-03-22T04:29:22.066678Z",
"url": "https://files.pythonhosted.org/packages/8b/db/ff7b00310354763c3bbee636a3e5ec838a97f635759db7962d9bb415fa4d/air2phin-0.0.21.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-22 04:29:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "WhaleOps",
"github_project": "air2phin",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "air2phin"
}