-
Notifications
You must be signed in to change notification settings - Fork 0
/
helper.py
78 lines (69 loc) · 1.9 KB
/
helper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import letter
import re,css
class Experience:
def __init__(self,exp):
exps=exp.split(":")
self.company=exps[0]
self.date=exps[1]
self.details=exps[2]
def getCompany(self):
return self.company
def getDate(self):
return "("+self.date+")"
def getDetails(self):
return self.details
def __str__(self):
return self.details
class Project:
def __init__(self,project):
exps=project.split(":")
self.proj=exps[0]
self.tech=exps[1]
self.details=exps[2]
def getCompany(self):
return self.proj
def getTech(self):
return "( Technology used : "+self.tech+")"
def getDetails(self):
return self.details
class Education:
def __init__(self,education):
exps=education.split(":")
self.qualification=exps[0]
self.school=exps[1]
self.date=exps[2]
self.marks=exps[3]
self.achievement=exps[4]
def getQualification(self):
return self.qualification
def getSchool(self):
return self.school
def getDate(self):
return self.date
def getMarks(self):
return self.marks
def getAchievements(self):
return self.achievement
def readCsv(path):
lines=[]
data={}
with open(path,'r') as file:
line=file.readline()
while line:
line=file.readline()
parts=re.split(r"[,]{1}[\"]?[&]{2}",line)
tmp=""
for part in parts:
if part.startswith('"') or part.endswith('"'):
part=part.strip('"')
tmp+=part+"\t"
lines.append(tmp)
for line in lines:
tmp=line.split('\t');
if len(tmp)>1:
#print(tmp)
data[tmp[1]]=tmp
return data
if __name__=='__main__':
pass