Skip to content

Commit cf155b4

Browse files
authored
Added senate_class field to be in CSV files
This is derived from the YAML
1 parent 821c920 commit cf155b4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scripts/alternate_bulk_formats.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ def generate_csv():
4343
("type", "type"),
4444
("state", "state"),
4545
("district", "district"),
46+
("class", "senate_class"),
4647
("party", "party"),
4748
("url", "url"),
4849
("address", "address"),
4950
("phone", "phone"),
5051
("contact_form", "contact_form"),
51-
("rss_url", "rss_url")
52+
("rss_url", "rss_url"),
5253
]
5354

5455
#pulled from legislators-social-media.yaml
@@ -158,14 +159,14 @@ def generate_json():
158159
print("Converting %s to JSON..." % filename)
159160
data = utils.load_data(filename)
160161
'''handle edge case of incorrect coercion for twitter ids in social media data
161-
json/js can only handle maximum of 53-bit integers, so 64-bit integer twitter ids *must* be stringified
162+
json/js can only handle maximum of 53-bit integers, so 64-bit integer twitter ids *must* be stringified
162163
to consistently preserve value in json. otherwise they may be rounded and malformed
163164
'''
164165
if 'legislators-social-media' in filename:
165166
for social_legislator in data:
166167
if 'twitter_id' in social_legislator['social']:
167168
social_legislator['social']['twitter_id'] = str(social_legislator['social']['twitter_id'])
168-
169+
169170
#convert yaml to json
170171
utils.write(
171172
json.dumps(data, default=utils.format_datetime, indent=2),

0 commit comments

Comments
 (0)