Package: airflow-code-editor
Airflow Code Editor PluginA plugin forApache Airflowthat allows you to edit DAGs in browser.
It provides a file managing interface within specified directories and it can be used to edit, upload, and download your files.
If git support is enabled, the DAGs are stored in a Git repository. You may use it to view Git history, review local changes and commit.System RequirementsAirflow Versions1.10.3 or newergit Versions (git is not required if git support is disabled)2.0 or newerScreenshotsFile ManagerEditorSearchGit HistoryGit WorkspaceInstall InstructionsDocker ImagesFor the ease of deployment, use the production-ready reference container image.
The image is based on the reference images for Apache Airflow.You can find the following images there:andreax79/airflow-code-editor:latest- the latest released Airflow Code Editor image with the latest Apache Airflow versionandreax79/airflow-code-editor:2.7.0- the latest released Airflow Code Editor with specific Airflow versionandreax79/airflow-code-editor:2.7.0-7.5.0- specific version of Airflow and Airflow Code EditorInstalling from PyPIInstall the pluginpipinstallairflow-code-editorInstall optional dependenciesblack - Black Python code formatterfs-s3fs - S3FS Amazon S3 Filesystemfs-gcsfs - Google Cloud Storage Filesystem... other filesystems supported by PyFilesystem - seehttps://www.pyfilesystem.org/page/index-of-filesystems/pipinstallblackfs-s3fsfs-gcsfsRestart the Airflow Web ServerOpen Admin - DAGs Code EditorConfig OptionsYou can set options editing the Airflow's configuration file or setting environment variables.
You can edit yourairflow.cfgadding any of the following settings in the [code_editor] section.
All the settings are optional.enabledenable this plugin (default: True).git_enabledenable git support (default: True). If git is not installed, disable this option.git_cmdgit command (path)git_default_argsgit arguments added to each call (default: -c color.ui=true)git_author_namehuman-readable name in the author/committer (default logged user first and last names)git_author_emailemail for the author/committer (default: logged user email)git_init_repoinitialize a git repo in DAGs folder (default: True)root_directoryroot folder (default: Airflow DAGs folder)line_lengthPython code formatter - max line length (default: 88)string_normalizationPython code formatter - if true normalize string quotes and prefixes (default: False)mount,mount1, ...  configure additional folder (mount point) - format: name=xxx,path=yyyignored_entriescomma-separated list of entries to be excluded from file/directory list (default: .*,__pycache__)[code_editor]
   enabled = True
   git_enabled = True
   git_cmd = /usr/bin/git
   git_default_args = -c color.ui=true
   git_init_repo = False
   root_directory = /home/airflow/dags
   line_length = 88
   string_normalization = False
   mount = name=data,path=/home/airflow/data
   mount1 = name=logs,path=/home/airflow/logs
   mount2 = name=data,path=s3://exampleMount Options:name: mount name (destination)path: local path or PyFilesystem FS URLs - seehttps://docs.pyfilesystem.org/en/latest/openers.htmlExample:name=ftp_server,path=ftp://user:pass@ftp.example.org/privatename=data,path=s3://examplename=tmp,path=/tmpYou can also set options with the following environment variables:AIRFLOW__CODE_EDITOR__ENABLEDAIRFLOW__CODE_EDITOR__GIT_ENABLEDAIRFLOW__CODE_EDITOR__GIT_CMDAIRFLOW__CODE_EDITOR__GIT_DEFAULT_ARGSAIRFLOW__CODE_EDITOR__GIT_AUTHOR_NAMEAIRFLOW__CODE_EDITOR__GIT_AUTHOR_EMAILAIRFLOW__CODE_EDITOR__GIT_INIT_REPOAIRFLOW__CODE_EDITOR__ROOT_DIRECTORYAIRFLOW__CODE_EDITOR__LINE_LENGTHAIRFLOW__CODE_EDITOR__STRING_NORMALIZATIONAIRFLOW__CODE_EDITOR__MOUNT, AIRFLOW__CODE_EDITOR__MOUNT1, AIRFLOW__CODE_EDITOR__MOUNT2, ...AIRFLOW__CODE_EDITOR__IGNORED_ENTRIESExample:export AIRFLOW__CODE_EDITOR__STRING_NORMALIZATION=True
   export AIRFLOW__CODE_EDITOR__MOUNT='name=data,path=/home/airflow/data'
   export AIRFLOW__CODE_EDITOR__MOUNT1='name=logs,path=/home/airflow/logs'
   export AIRFLOW__CODE_EDITOR__MOUNT2='name=tmp,path=/tmp'Development InstructionsFork the repoClone it on the local machinegitclonehttps://github.com/andreax79/airflow-code-editor.gitcdairflow-code-editorCreate dev imagemakedev-imageSwitch node versionnvmuseMake changes you need. Build npm package with:makenpm-buildYou can start Airflow webserver with:makewebserverRun testsmaketestCommit and push changesCreatepull requestto the original repoLinksApache AirflowCodemirror, In-browser code editorGit WebUI, A standalone local web based user interface for git repositoriesBlack, The Uncompromising Code Formatterpss, power-tool for searching source filesVue.jsVue-good-table, data table for VueJSVue-tree, TreeView control for VueJSVue-universal-modal Universal modal plugin for Vue@3Vue-simple-context-menuSplitpanesAxios, Promise based HTTP client for the browser and node.jsPyFilesystem2, Python's Filesystem abstraction layerAmazon S3 PyFilesystemGoogle Cloud Storage PyFilesystem