Created
November 15, 2023 21:00
-
-
Save ErikBoesen/cea63daad88b0b72ad1ccd1eaf4229fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yalies | |
import os | |
import csv | |
api = yalies.API(os.environ['YALIES_API_KEY']) | |
people = api.people(filters={'school_code': 'YC'}) | |
columns = [ | |
'first_name', 'last_name', 'email', 'college', 'college_code', 'year', 'leave', 'major', 'address', | |
] | |
with open('undergrads.csv', 'w') as csv_file: | |
writer = csv.writer(csv_file) | |
writer.writerow(columns) | |
for person in people: | |
writer.writerow([person.raw[key] for key in columns]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment