Skip to content

Commit

Permalink
fix: delete non existing table
Browse files Browse the repository at this point in the history
  • Loading branch information
folland87 committed Mar 15, 2024
1 parent 26dd0cf commit 182cd7f
Showing 1 changed file with 35 additions and 32 deletions.
67 changes: 35 additions & 32 deletions ecorda/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import sys, time, os
import sys
import time
import os

from ecorda.new_date import NewDate
from ecorda.load_all import extraction_all
Expand All @@ -9,50 +11,51 @@

logger = get_logger(__name__)


def run_ecorda_pipeline() -> None:
URL = os.getenv('ECORDA_ENDPOINT')
extractionDate = NewDate('HORIZON', URL)
logger.debug(f'extractionDate : {extractionDate}')
LIST_DATA = ['extractionDate',
'countries',
'eurostatNuts',
'calls',
'topics',
'topicLbDivisions',
'typeOfActions',
'typeOfActionsAttributes',
'proposals',
'proposals/applicants',
'proposals/applicants/departments',
'proposals/keywords',
'projects',
'projects/participants',
'projects/principalInvestigators',
'projects/participants/departments',
'legalEntities',
'legalEntitiesDepartments',
'legalEntitiesLinks',
'projects/payments',
'projects/reporting/formC',
'projects/reporting/iprs',
'projects/euroSciVocTaxonomy',
'projects/reporting/publications',
'projects/hrpResult',
'projects/innovationRadar',
'projects/cascadingProjects',
'projects/participants/cascadingParticipants',
'projects/datasets'
]
'countries',
'eurostatNuts',
'calls',
'topics',
'topicLbDivisions',
'typeOfActions',
'typeOfActionsAttributes',
'proposals',
'proposals/applicants',
'proposals/applicants/departments',
'proposals/keywords',
'projects',
'projects/participants',
'projects/principalInvestigators',
'projects/participants/departments',
'legalEntities',
'legalEntitiesDepartments',
'legalEntitiesLinks',
'projects/payments',
'projects/reporting/formC',
'projects/reporting/iprs',
'projects/euroSciVocTaxonomy',
'projects/reporting/publications',
'projects/hrpResult',
# 'projects/innovationRadar',
'projects/cascadingProjects',
'projects/participants/cascadingParticipants',
'projects/datasets'
]

extraction_all('HORIZON', LIST_DATA, URL)
create_csv_json('HORIZON', LIST_DATA)

filename_prefix = 'HE_'
extension_liste = ['.csv', '.json']
for ext in extension_liste:
zip_filename = f'{filename_prefix}{extractionDate}{ext}.zip'
zip_filename = f'{filename_prefix}{extractionDate}{ext}.zip'
latest_filename = f'{filename_prefix}latest{ext}.zip'

zip_create(zip_filename, ext)
os.system(f'cp {zip_filename} {latest_filename}')

Expand Down

0 comments on commit 182cd7f

Please sign in to comment.