Skip to content

Commit

Permalink
committing minor changes
Browse files Browse the repository at this point in the history
RDiPiazza committed Nov 24, 2024
1 parent c3f6af7 commit 1ad5367
Showing 8 changed files with 4,922 additions and 17 deletions.
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@ services:
#entrypoint: ["python", "quotaclimat/data_processing/mediatree/api_import.py"]
environment:
ENV: docker # change me to prod for real cases
LOGLEVEL: DEBUG # Change me to info (debug, info, warning, error) to have less log
LOGLEVEL: INFO # Change me to info (debug, info, warning, error) to have less log
PYTHONPATH: /app
POSTGRES_USER: user
POSTGRES_DB: barometre
@@ -116,8 +116,8 @@ services:
#UPDATE: "true" # to batch update PG
#UPDATE_PROGRAM_ONLY: "true" # to batch update PG but only channel with program
# START_OFFSET: 100 # to batch update PG from a offset
START_DATE: 1714026680 # to test batch import
CHANNEL : france2 # to reimport only one channel
START_DATE: 1717127469 # to test batch import
# CHANNEL : france2 # to reimport only one channel
MEDIATREE_USER : /run/secrets/username_api
MEDIATREE_PASSWORD: /run/secrets/pwd_api
MEDIATREE_AUTH_URL: https://keywords.mediatree.fr/api/auth/token/
24 changes: 24 additions & 0 deletions econ_from_excel_to_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import json
import pandas as pd

input_file_path = 'C:/Users/RaphaëldiPIAZZA/OneDrive - eleven/0_ADMIN/EXTERNE/Baromètre/eco/mots_cles_econ.xlsx'
output_file_path = 'keywords_economie.json'

df = pd.read_excel(input_file_path)

KEY_WORDS_ECONOMIE = []

for index, row in df.iterrows():
theme_name = 'economie'
if pd.isna(row['Thème']):
row['Thème'] = ''
cur_dict = {
'keyword': row['Mot clé']
, 'category': row['Thème']
}
KEY_WORDS_ECONOMIE.append(cur_dict)

with open(output_file_path, 'w', encoding='utf-8') as file:
json.dump(KEY_WORDS_ECONOMIE, file, ensure_ascii=False, indent=4)

print(f"Keywords written in {output_file_path}")
15 changes: 15 additions & 0 deletions host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}
Loading

0 comments on commit 1ad5367

Please sign in to comment.