Skip to content

Instantly share code, notes, and snippets.

@ErikBoesen
Created November 15, 2023 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ErikBoesen/cea63daad88b0b72ad1ccd1eaf4229fc to your computer and use it in GitHub Desktop.
Save ErikBoesen/cea63daad88b0b72ad1ccd1eaf4229fc to your computer and use it in GitHub Desktop.
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