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:
bchartoff
2013-08-05 13:09:27 -04:00
parent 849c2d084a
commit f0133a7bb9
3 changed files with 169 additions and 0 deletions

View File

@@ -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')