mirror of
https://github.com/unitedstates/congress-legislators.git
synced 2025-12-19 09:50:37 -05:00
22 lines
475 B
Python
22 lines
475 B
Python
import json
|
|
import utils
|
|
import glob
|
|
import os
|
|
|
|
def run():
|
|
|
|
#yaml filenames
|
|
yamls = list(map(os.path.basename, glob.glob("../*.yaml")))
|
|
|
|
for filename in yamls:
|
|
print("Converting %s..." % filename)
|
|
data = utils.load_data(filename)
|
|
|
|
#convert yaml to json
|
|
utils.write(
|
|
json.dumps(data, default=utils.format_datetime),
|
|
"../alternate_formats/%s.json" %filename.replace(".yaml", ""))
|
|
|
|
if __name__ == '__main__':
|
|
run()
|