Ditto
Ditto is a framework which allows you to do transformations to an Airflow DAG, to convert it into another DAG which is flow-isomorphic with the original DAG. i.e. it will orchestrate a flow of operators which yields the same results, but was just transformed to run in another environment or platform. The framework was built to transform EMR DAGs to run on Azure HDInsight, but you can extend the rich API for any other kind of transformation. In fact you can transform DAGs such that the result is not isomorphic too if you want (although at that point you're better off writing a whole new DAG).
The purpose of the framework is to allow you to maintain one codebase and be able to run your airflow DAGs on different execution environments (e.g. on different clouds, or even different container frameworks - spark on YARN vs kubernetes). It is not meant for a one-time transformation, but for continuous and parallel DAG deployments, although you can use it for that purpose too.
At the heart, Ditto is a graph manipulation library, which extendable APIs for the actual transformation logic. It does come with out of the box support for EMR to HDInsight transformation though.
Installation
pip install airflow-ditto
A quick example
Ditto is created for conveniently transforming a large number of DAGs which follow a similar pattern quickly. Here's how easy it is to use Ditto:
ditto = ditto.AirflowDagTransformer(DAG(
dag_id='transformed_dag',
default_args=DEFAULT_DAG_ARGS
), transformer_resolvers=[
ClassTransformerResolver(
{SlackAPIOperator: TestTransformer1,
S3CopyObjectOperator: TestTransformer2,
BranchPythonOperator: TestTransformer3,
PythonOperator: TestTransformer4}
)])
new_dag = ditto.transform(original_dag)
You can put the above call in any python file which is visible to airflow and the resultant dag loads up thanks to how airflow's dagbag finds DAGs.
Source DAG (airflow view)
Transformed DAG
Read the detailed documentation here
Metadata
Release files for airflow-ditto 0.0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| airflow-ditto-0.0.1.2.tar.gz | 11.1 kB | Without provenance | Details for airflow-ditto-0.0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| airflow_ditto-0.0.1.2-py3-none-any.whl | Python 3 | none | any | Details for airflow_ditto-0.0.1.2-py3-none-any.whl |
Total release size: 36.4 kB
Release files / airflow-ditto-0.0.1.2.tar.gz
| Download URL | airflow-ditto-0.0.1.2.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f489b041791032909af74948e93cee4987710d76f3bb7773e6b1c201ded571a
|
|
BLAKE2b-256 checksum How to use checksums |
a0127016888549d11759663f163fae86e8a3e7570f1f87dc0591fddc86a65302
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
|
Release files / airflow_ditto-0.0.1.2-py3-none-any.whl
| Download URL | airflow_ditto-0.0.1.2-py3-none-any.whl |
|---|---|
| Size | 25.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a8f131a748e35dc18cf8c68ddfa554683366b289ef40cb9d10a67db16b3daaf
|
|
BLAKE2b-256 checksum How to use checksums |
733cc4bdc561a418937a7fd42692d21474af6f952946086ad0a143dc12e26435
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
|
Security for airflow-ditto 0.0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.