Skip to main content

Airflow GPG Plugin

Latest Version Python Versions

Airflow plugin with hooks and operators to work with GPG encryption and decryption.

Installation

Use the package manager pip to install foobar.

pip install airflow-gpg-plugin

Usage

Add an airflow connection from shell.

login is the email address in the GPG key.

password is the passphrase of the GPG key.

airflow connections add 'gpg_default_conn' \
    --conn-type 'gpg' \
    --conn-login 'gpgexamplepassphrase@example.com' \
    --conn-password 'gpgexamplepassphrase' \
    --conn-host '' \
    --conn-port '' \
    --conn-extra '{"key_file": "tests/resources/gpgexamplepassphrase.asc"}'

Using operators to encrypt and decrypt files.

import os
from datetime import datetime

from airflow import DAG
from airflow_gpg_plugin.operators.gpg_decrypt_file_operator import GPGDecryptFileOperator
from airflow_gpg_plugin.operators.gpg_encrypt_file_operator import GPGEncryptFileOperator
gpg_conn_id = "gpg_default_conn"

dag = DAG(dag_id="gpg_example",
          start_date=datetime(2021, 1, 1),
          schedule_interval=None
          )

encrypt = GPGEncryptFileOperator(
    task_id="gpg_encrypt",
    dag=dag,
    conn_id=gpg_conn_id,
    input_file_path=os.curdir + "/README.md",
    output_file_path=os.curdir + "/README.md.gpg"
)
decrypt = GPGDecryptFileOperator(
    task_id="gpg_decrypt",
    dag=dag,
    conn_id=gpg_conn_id,
    input_file_path=os.curdir + "/README.md.gpg",
    output_file_path=os.curdir + "/README.md.txt"
)

encrypt >> decrypt

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Metadata

Release files for airflow-gpg-plugin 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for airflow-gpg-plugin 0.2.0
File Size Uploaded
airflow-gpg-plugin-0.2.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for airflow-gpg-plugin 0.2.0
File Interpreter ABI Platform
airflow_gpg_plugin-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.5 kB

Release files / airflow-gpg-plugin-0.2.0.tar.gz

Download URL airflow-gpg-plugin-0.2.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5939008dab24e2e1c26eb550e101a94d87ef67414e6861415211b0f5089112bc
BLAKE2b-256 checksum
How to use checksums
cd215242c72dd7fcd1689f0cdff2f4edfc55feb1db600ed30c29163204b78885
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

Release files / airflow_gpg_plugin-0.2.0-py3-none-any.whl

Download URL airflow_gpg_plugin-0.2.0-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e429d00f1fffb2d2e7ceb08bf873dfb6d9056f347b05a8bb9db61fb7047d901
BLAKE2b-256 checksum
How to use checksums
6833ca3bc0ba55cbf5386149ca9f4f085e14c520367547dbd327b4463859b9a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page