示例#1
0
    def __init__(self, file):
        self.file = file
        with open(file, 'rb') as csvfile:
            self.csvData = list(csv.reader(csvfile))

        with open(file, 'wb') as csvfile:
            writer = csv.writer(csvfile)
            writer.writerows(self.csvData)

        print('which is the resume?')
        self.resumeCol = ui.getChoice(self.csvData[0], range(len(self.csvData[0])))

        print('where do labels go?')
        labelCol = ui.getChoice(self.csvData[0] + ['[ new ]'], range(len(self.csvData[0]) + 1))
        self.labelCol = labelCol

        print('is there a header row?')
        hasHeader = ui.getChoice(['yes', 'no'], [True, False])
        if(hasHeader):
            if(not self.csvData[0][labelCol]):
                self.csvData[0][labelCol] = 'label'

        resumes = [
                ResumeFromCsv(
                    row,
                    self.resumeCol,
                    labelCol,
                    self.save
                ) for row in self.csvData[hasHeader:]
                    if(labelCol >= len(row) or not row[labelCol])
            ]
        super(CsvResumeScrubber, self).__init__(resumes)
示例#2
0
    def __init__(self, file):
        self.file = file
        with open(file, "rb") as csvfile:
            self.csvData = list(csv.reader(csvfile))

        with open(file, "wb") as csvfile:
            writer = csv.writer(csvfile)
            writer.writerows(self.csvData)

        print("which is the resume?")
        self.resumeCol = ui.getChoice(self.csvData[0], range(len(self.csvData[0])))

        print("where do labels go?")
        labelCol = ui.getChoice(self.csvData[0] + ["[ new ]"], range(len(self.csvData[0]) + 1))
        self.labelCol = labelCol

        print("is there a header row?")
        hasHeader = ui.getChoice(["yes", "no"], [True, False])
        if hasHeader:
            if not self.csvData[0][labelCol]:
                self.csvData[0][labelCol] = "label"

        resumes = [
            ResumeFromCsv(row, self.resumeCol, labelCol, self.save)
            for row in self.csvData[hasHeader:]
            if (labelCol >= len(row) or not row[labelCol])
        ]
        super(CsvResumeScrubber, self).__init__(resumes)
示例#3
0
#!/usr/bin/env python

from dirScrubber import DirResumeScrubber
from csvScrubber import CsvResumeScrubber
import uicomponents as ui
import sys

labels = [
    'one Fulltime', 'two Fulltime', 'three Fulltime', 'one Intern',
    'two Intern', 'three Intern', 'flag', 'waitlist'
]

print('What is the resume list format?')
format = ui.getChoice(['csv', 'file glob'])
print('\n')

scrubber = None
if (format == 'csv'):
    file = sys.argv[1]
    if (not file):
        file = raw_input('enter file name:\n')
    scrubber = CsvResumeScrubber(file)
elif (format == 'file glob'):
    glob = sys.argv[1]
    if (not glob):
        glob = raw_input('enter glob:\n')
    scrubber = DirResumeScrubber(glob)

for resume in scrubber:
    resume.open()
    choice = ui.getChoice(labels)
示例#4
0
import uicomponents as ui
import sys

labels = [
    'one Fulltime',
    'two Fulltime',
    'three Fulltime',
    'one Intern',
    'two Intern',
    'three Intern',
    'flag',
    'waitlist'
]

print('What is the resume list format?')
format = ui.getChoice(['csv', 'file glob'])
print('\n')

scrubber = None
if(format == 'csv'):
    file = sys.argv[1]
    if(not file):
        file = raw_input('enter file name:\n')
    scrubber = CsvResumeScrubber(file)
elif(format == 'file glob'):
    glob = sys.argv[1]
    if(not glob):
        glob = raw_input('enter glob:\n')
    scrubber = DirResumeScrubber(glob)

for resume in scrubber: