@@ -43,12 +43,13 @@ def generate_csv():
43
43
("type" , "type" ),
44
44
("state" , "state" ),
45
45
("district" , "district" ),
46
+ ("class" , "senate_class" ),
46
47
("party" , "party" ),
47
48
("url" , "url" ),
48
49
("address" , "address" ),
49
50
("phone" , "phone" ),
50
51
("contact_form" , "contact_form" ),
51
- ("rss_url" , "rss_url" )
52
+ ("rss_url" , "rss_url" ),
52
53
]
53
54
54
55
#pulled from legislators-social-media.yaml
@@ -158,14 +159,14 @@ def generate_json():
158
159
print ("Converting %s to JSON..." % filename )
159
160
data = utils .load_data (filename )
160
161
'''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
162
163
to consistently preserve value in json. otherwise they may be rounded and malformed
163
164
'''
164
165
if 'legislators-social-media' in filename :
165
166
for social_legislator in data :
166
167
if 'twitter_id' in social_legislator ['social' ]:
167
168
social_legislator ['social' ]['twitter_id' ] = str (social_legislator ['social' ]['twitter_id' ])
168
-
169
+
169
170
#convert yaml to json
170
171
utils .write (
171
172
json .dumps (data , default = utils .format_datetime , indent = 2 ),
0 commit comments