Skip to content

Commit

Permalink
Merge pull request #200 from ResidenciaTICBrisa/testando_actions
Browse files Browse the repository at this point in the history
Testando git actions
  • Loading branch information
EduardoGurgel authored Oct 19, 2023
2 parents 69c9fc6 + 0ad9355 commit 4774cb8
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/atualiza_tabelas.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: run main.py

on:
schedule: [{cron: "0 0 * * 1"}] #agendamento
schedule: [{cron: "0 19 * * 3"}] #agendamento

jobs:
build:
Expand Down
94 changes: 47 additions & 47 deletions 04_PipelineTCU/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,53 @@
path_dir = str(pathlib.Path(__file__).parent.resolve())
path_consts = path_dir + '/constants/'
path_raiz = path_dir[0:-14]
# name_left = 'Anuário'
# year = year_atual
# name_right = 'Workbook'
# url_site = 'https://www.epe.gov.br/pt/publicacoes-dados-abertos/publicacoes/anuario-estatistico-de-energia-eletrica'
# url_final = 'https://www.epe.gov.br'
# file = 'Anuario.xlsx'
# cont = 0
# while(cont < 10):
# scrapper = ExcelScrapper(name_left, str(year), name_right, url_site, url_final, file, path_raiz, path_consts)
# if scrapper.link != None:
# if scrapper.getFile():
# anuario = AnuarioHandler(file, path_consts)
# anuario.generateTables()
# break
# year -= 1
# cont += 1
# name_left = 'Matrizes Consolidadas'
# year = year_atual
# name_right = ''
# url_site = 'https://www.epe.gov.br/pt/publicacoes-dados-abertos/publicacoes/BEN-Series-Historicas-Completas'
# file = 'BEN.xlsx'
# cont = 0
# while(cont < 10):
# scrapper = ExcelScrapper(name_left, str(year), name_right, url_site, url_final, file, path_raiz, path_consts)
# if scrapper.link != None:
# if scrapper.getFile():
# ben = BenHandler(file, path_consts)
# ben.generateTable()
# break
# year -= 1
# cont += 1
# name_left = 'Relatórios de saída'
# name_right = ''
# url_site = 'https://www.epe.gov.br/pt/publicacoes-dados-abertos/publicacoes/Plano-Nacional-de-Energia-2050'
# scrapper = ZipScrapper(name_left, name_right, url_site, url_final, path_consts + 'Dados_saida_eletricidade/')
# if scrapper.link != None:
# if scrapper.getFile():
# pne = PNEHandler(path_consts + 'Dados_saida_eletricidade/', path_consts + 'Cenarios_PNE/')
# pne.generaterTables()
# name_left = 'EmissoesGEE'
# url_site = 'https://www.gov.br/mcti/pt-br/acompanhe-o-mcti/indicadores/paginas/dados-abertos/dados-abertos-mctic/sirene-sistema-de-registro-nacional-de-emissoes'
# file = 'ComunicacaoNacional.xlsx'
# scrapper = ExcelScrapperByHref(name_left, url_site, file, path_raiz, path_consts)
# if scrapper.link != None:
# if scrapper.getFile():
# comunicacao = ComunicacaoHandler(file, path_consts, path_consts)
# comunicacao.generateTable()
name_left = 'Anuário'
year = year_atual
name_right = 'Workbook'
url_site = 'https://www.epe.gov.br/pt/publicacoes-dados-abertos/publicacoes/anuario-estatistico-de-energia-eletrica'
url_final = 'https://www.epe.gov.br'
file = 'Anuario.xlsx'
cont = 0
while(cont < 10):
scrapper = ExcelScrapper(name_left, str(year), name_right, url_site, url_final, file, path_raiz, path_consts)
if scrapper.link != None:
if scrapper.getFile():
anuario = AnuarioHandler(file, path_consts)
anuario.generateTables()
break
year -= 1
cont += 1
name_left = 'Matrizes Consolidadas'
year = year_atual
name_right = ''
url_site = 'https://www.epe.gov.br/pt/publicacoes-dados-abertos/publicacoes/BEN-Series-Historicas-Completas'
file = 'BEN.xlsx'
cont = 0
while(cont < 10):
scrapper = ExcelScrapper(name_left, str(year), name_right, url_site, url_final, file, path_raiz, path_consts)
if scrapper.link != None:
if scrapper.getFile():
ben = BenHandler(file, path_consts)
ben.generateTable()
break
year -= 1
cont += 1
name_left = 'Relatórios de saída'
name_right = ''
url_site = 'https://www.epe.gov.br/pt/publicacoes-dados-abertos/publicacoes/Plano-Nacional-de-Energia-2050'
scrapper = ZipScrapper(name_left, name_right, url_site, url_final, path_consts + 'Dados_saida_eletricidade/')
if scrapper.link != None:
if scrapper.getFile():
pne = PNEHandler(path_consts + 'Dados_saida_eletricidade/', path_consts + 'Cenarios_PNE/')
pne.generaterTables()
name_left = 'EmissoesGEE'
url_site = 'https://www.gov.br/mcti/pt-br/acompanhe-o-mcti/indicadores/paginas/dados-abertos/dados-abertos-mctic/sirene-sistema-de-registro-nacional-de-emissoes'
file = 'ComunicacaoNacional.xlsx'
scrapper = ExcelScrapperByHref(name_left, url_site, file, path_raiz, path_consts)
if scrapper.link != None:
if scrapper.getFile():
comunicacao = ComunicacaoHandler(file, path_consts, path_consts)
comunicacao.generateTable()
name_left = 'PCBIO'
year = year_atual
url_site = 'https://www.ccee.org.br/web/guest/pre%C3%A7o-m%C3%A9dio-de-descarboniza%C3%A7%C3%A3o-informa%C3%A7%C3%B5es'
Expand Down

0 comments on commit 4774cb8

Please sign in to comment.