diff --git a/mexico2024-officeholders.json b/mexico2024-officeholders.json new file mode 100644 index 0000000..659a8e6 --- /dev/null +++ b/mexico2024-officeholders.json @@ -0,0 +1,32 @@ +{ + "country:": "Mexico", + "SHEET_ID": "1VG_5C-Pti-S5CJUmwVaKIeetiN4N2NTMqxM7kIlfcb4", + "ST_RANGES": { + "area": "A1:J1191", + "chamber": "A1:C1190", + "role": "A1:F1190", + "contest": "A1:G1190", + "coalition": "A1:D128", + "party": "A1:F93", + "profession": "A1:B122", + "url_types": "B2:B23" + }, + "CAPTURE_SHEET_ID": "1h-l_TadufHO49hWQ_TnkQ2Bb0DiQncXWC6cE-pPzR1M", + "READ_RANGE": "Captura!A1:AW5000", + "COALITION_URL_RANGE": "URL_logo_partido_coal!A1:H37", + "PARTY_URL_RANGE": "URL_logo_partido_coal!I1:R62", + "person_header": [ + "person_id", + "full_name", + "first_name", + "last_name", + "date_birth", + "gender", + "dead_or_alive", + "last_degree_of_studies", + "contest_id", + "profession_1", + "replaced_person_id", + "is_elected_2024" + ] +} diff --git a/mexico2024.json b/mexico2024.json index 9ed2043..5c53039 100644 --- a/mexico2024.json +++ b/mexico2024.json @@ -26,6 +26,7 @@ "last_degree_of_studies", "contest_id", "profession_1", - "replaced_person_id" + "replaced_person_id", + "is_elected_2024" ] } diff --git a/utils.py b/utils.py index 3998536..915636e 100644 --- a/utils.py +++ b/utils.py @@ -597,7 +597,8 @@ def get_dummy_data(endpoint): "contest_id": -1, "person_id": -1, "profession_1": '', - "replaced_person_id": None + "replaced_person_id": None, + "is_elected_2024": False } elif endpoint == "other-name": dummy_data = { @@ -742,7 +743,7 @@ def send_data(base_url, endpoint, dataset): r = requests.post(full_url, json=row, headers=HEADERS) if r.status_code != 201: print(f"[ERROR]: {endpoint} #{i} status code: {r.status_code}") - print(f"msg: {r.json()['message']}") + print(f"msg: {r.json()['message']} | data:{row}") except r_excepts.ConnectionError: print("[CONNECTION ERROR]") print(f"#{i} | url: {full_url} | data:{row}")