Open elyse-weiss opened 1 year ago
@elyse-weiss - I have a contributor potentially interested in working on this. Do you know if TMC still has access to the AP API that we could use to test out a new connector?
TMC is very likely getting the API again this year, but I feel fairly certain they do not have it yet.
Proposed new AP Elections class for use with Associated Press API.
Detailed Description
TMC purchased the Associated Press API in both 2020 and 2022. The code is in this Github gist: https://gist.github.com/elyse-weiss/77385e02430df8b3d2f135c6f9ff470b
I do not have time at this moment to formalize into a Parsons class, but figured someone else might. There are two scripts included:
ap_election.py
During a new calendar year, the following updates need to be made to
apelection.py
:API_URL
: the AP may upgrade from v3OUTPUT_FIELDS
: the AP may add new fieldsupdate_election_data.py
https://api.ap.org/v3/elections/{election_date}?format=json&level={level}&resultstype={test}&statepostal=%{stateid}&minDateTime={timestamp}
Context
At TMC, we chose to push the data to Postgres since we were running the job to hit against the API every 5 minutes.
Possible Implementation
Priority
low priority