mirror of
https://github.com/unitedstates/congress-legislators.git
synced 2025-12-25 02:14:46 -05:00
Scripts to create csv and json legislator bulk files
json script is straightforward (and easily adaptable to other yamls), csv script tightly linked to data.
This commit is contained in:
@@ -229,6 +229,14 @@ def download(url, destination=None, force=False, options=None):
|
||||
|
||||
return body
|
||||
|
||||
def format_datetime(obj):
|
||||
if isinstance(obj, datetime.datetime):
|
||||
return eastern_time_zone.localize(obj.replace(microsecond=0)).isoformat()
|
||||
elif isinstance(obj, str):
|
||||
return obj
|
||||
else:
|
||||
return None
|
||||
|
||||
def write(content, destination):
|
||||
mkdir_p(os.path.dirname(destination))
|
||||
f = open(destination, 'w')
|
||||
|
||||
Reference in New Issue
Block a user