Skip to main content

Provider do Airflow para comunicação com Tesouro Gerencial

Project description

airflow-providers-tesouro-gerencial

Provider do Airflow para comunicação com Tesouro Gerencial.

Instalação

pip install airflow-providers-tesouro-gerencial

Conteúdo

  • Hook para conexão com Tesouro Gerencial, que contém métodos para:

    • Entrada e saída de contexto (clásula with), inicializando e encerrando sessão no Tesouro Gerencial
    • Execução e exportação de relatório
  • Transfers que carregam relatórios do Tesouro Gerencial para:

    • Arquivo local;
    • Banco MongoDB

Exemplo de Uso

Transferência de relatório para arquivo local:

from datetime import datetime, timedelta

from airflow.decorators import dag
from airflow.providers.tesouro_gerencial.transfers.relatorio_para_arquivo import RelatorioParaArquivo


@dag(schedule_interval=None, start_date=datetime(2021, 1, 1))
def teste_tesouro_gerencial():
    teste = RelatorioParaArquivo(
        task_id='teste1',
        id_conexao_siafi='teste',
        id_relatorio='970A89D511EC923631090080EFC5BFD1',
        caminho_arquivo='/tmp/tg.xlsx',
        respostas_prompts_valor=['622110000', '622120000'],
        retries=10,
        retry_delay=timedelta(minutes=2)
    )

minha_dag = teste_tesouro_gerencial()

Transferência para banco MongoDB

from datetime import datetime, timedelta

from airflow.decorators import dag
from airflow.providers.tesouro_gerencial.transfers.relatorio_para_mongo import RelatorioParaMongo


@dag(schedule_interval=None, start_date=datetime(2021, 1, 1))
def teste_tesouro_gerencial():
    teste = RelatorioParaMongo(
        task_id='teste2',
        id_conexao_siafi='teste',
        id_relatorio='970D89D511EC423631090080EFA5BFD1',
        id_conexao_mongo='teste_mongo',
        banco='teste',
        colecao='teste',
        respostas_prompts_valor=['622110000', '622120000'],
        truncar_colecao=True,
        nulos_para_zero=True,
        retries=10,
        retry_delay=timedelta(minutes=2)
    )


minha_dag = teste_tesouro_gerencial()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file airflow-providers-tesouro-gerencial-1.3.0.tar.gz.

File metadata

  • Download URL: airflow-providers-tesouro-gerencial-1.3.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

File hashes

Hashes for airflow-providers-tesouro-gerencial-1.3.0.tar.gz
Algorithm Hash digest
SHA256 8f1da334dfbf6e1440e27a354ec19106e59de562c63e277be5bbfee42566c197
MD5 52e96909b91a266ce41408e76f00596a
BLAKE2b-256 c811b5a45a2767b1717cff757ee6b403230142ce839143fc624b20ed13bde467

See more details on using hashes here.

File details

Details for the file airflow_providers_tesouro_gerencial-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_providers_tesouro_gerencial-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fa57c40e06db494c9bfef93e481459169f11faa7282d22e38e12897dacc4b28
MD5 92bac7163ff4c4538fe9b3841043b45d
BLAKE2b-256 bfbc1bfb717479bef61098a0f50b61907b89c991fdb5fa4f730db11684bac300

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page