Created
November 23, 2016 22:59
-
-
Save MatthewDailey/67d3603f6da293e78c95e74c408b2237 to your computer and use it in GitHub Desktop.
Parse salary and ownership ranges from copy-paste angellist job search.
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 re | |
''' | |
To run: | |
- select all from https://angel.co/jobs#find/f!%7B%22locations%22%3A%5B%221624-California%22%5D%2C%22roles%22%3A%5B%22Software%20Engineer%22%5D%2C%22types%22%3A%5B%22full-time%22%5D%2C%22company_size%22%3A%221-10%22%2C%22company_stage%22%3A%5B%22Seed%22%2C%22Series%20A%22%5D%7D | |
- copy&paste in to 'jobs.txt' | |
- in the same directory, put this file ('parsejobs.py') and run 'python parsejobs.py' to print output. | |
''' | |
f = open('jobs.txt') | |
lines = f.readlines() | |
fulltime = [ x for x in lines if 'Full Time' in x ] | |
fulltime = [ x for x in fulltime if 'Engineer ' in x or 'Developer' in x ] | |
parsedJobs = [ (job.split('$')[0], re.findall('\$[0-9]+k', job), re.findall('[0-9]+\.[0-9]+', job)) for job in fulltime ] | |
csvjobs = [ (j, s[0], s[1], o[0], o[1]) for (j, s, o) in parsedJobs if len(s) > 0 and len(o) > 0 ] | |
stringJobs = [ ','.join(map(str,job)).replace('k','').replace('$','') for job in csvjobs ] | |
for s in stringJobs: | |
print s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment