airflow-gpg-plugin-0.2.0
توضیحات
Airflow plugin to work with GPG files.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | airflow-gpg-plugin-0.2.0 |
| نام | airflow-gpg-plugin |
| نسخه کتابخانه | 0.2.0 |
| نگهدارنده | ['Tilak Patidar'] |
| ایمیل نگهدارنده | ['tilakpatidar@gmail.com'] |
| نویسنده | Tilak Patidar |
| ایمیل نویسنده | tilakpatidar@gmail.com |
| آدرس صفحه اصلی | https://github.com/tilakpatidar/fibber-csv |
| آدرس اینترنتی | https://pypi.org/project/airflow-gpg-plugin/ |
| مجوز | MIT |
# Airflow GPG Plugin
[](https://pypi.org/project/airflow-gpg-plugin/)
[](https://pypi.org/project/airflow-gpg-plugin/)
Airflow plugin with hooks and operators to work with GPG encryption and decryption.
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install foobar.
```bash
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.
```shell
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.
```python
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](https://choosealicense.com/licenses/mit/)
نیازمندی
| مقدار | نام |
|---|---|
| >=2.0.0 | apache-airflow |
| <=0.4.8 | python-gnupg |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6.7 | Python |
نحوه نصب
نصب پکیج whl airflow-gpg-plugin-0.2.0:
pip install airflow-gpg-plugin-0.2.0.whl
نصب پکیج tar.gz airflow-gpg-plugin-0.2.0:
pip install airflow-gpg-plugin-0.2.0.tar.gz