11# -*- encoding: utf-8 -*-
22"""
3+
34Cvscan command line tool
5+
46"""
57
68import click
79import pprint
810
911from cvscan import Cvscan
12+ from cvscan import data_operations as do
1013
1114# Disable the warning that Click displays (as of Click version 5.0) when users
1215# use unicode_literals in Python 2.
@@ -18,21 +21,88 @@ def main():
1821 """Cvscan command line tool."""
1922 pass
2023
24+
2125@main .command ()
22- @click .option ('--name' , '-n' , help = 'Redis key to be watched ' )
26+ @click .option ('--name' , '-n' , help = 'Parse resume ' )
2327def parse (name ):
24- """Watching Redis for key."""
28+ """
29+
30+ Parse resume\n
31+ Params: name Type: string\n
32+ Usage: cvscan parse --name <name>\n
33+ to parse file: ~/cvscan/<name>.pdf
34+
35+ """
2536 resume = Cvscan (name )
2637 resume .parse ()
2738 pprint .pprint (resume .show (), width = 1 )
2839
29- # @main.command()
30- # @click.option('--skill','-s', help="Enter skill to remove")
31- # def remove_skill(skill):
32- # if skill:
33- # with open(dirpath.PKGPATH + '/data/skills/skills','rb') as fp:
34- # skills = pickle.load(fp)
35- # if skill not in skills:
36- # print "%s is not present in skills" % skill
37- # else:
38- # skills.remove(skill)
40+
41+ @main .command ()
42+ @click .option ('--org' ,'-o' ,help = 'Explicitly add organizations' )
43+ @click .option ('--skill' ,'-s' ,help = 'Add skills' )
44+ @click .option ('--job' ,'-j' ,help = 'For adding jobs: -j <job:category>' )
45+ def add (org ,skill ,job ):
46+ """
47+
48+ Add data to be considered\n
49+ Params: \n
50+ org Type: comma separated string\n
51+ skill Type: comma separated string\n
52+ job Type: comma separated string (comma separated - job:category)\n
53+ Usage:\n
54+ For adding organization:\n
55+ cvscan add --org <org_name,org_name,...>\n
56+ For adding skill:\n
57+ cvscan add --skill <skill,skill,...>\n
58+ For adding job:\n
59+ cvscan add --job <job:category,job:category,...>\n
60+ The above can be combined together also. Eg:\n
61+ cvscan add -o <org_name,org_name,..> -s <skill,skill,..> is also valid
62+
63+ """
64+ if org :
65+ do .add_organizations (org .split (',' ))
66+ if skill :
67+ do .add_skills (skill .split (',' ))
68+ if job :
69+ jobs = {}
70+ for _job in job .split (',' ):
71+ try :
72+ _job = _job .split (':' )
73+ jobs [_job [0 ]] = _job [1 ]
74+ except Exception :
75+ print "Something wnet wrong: " + Exception
76+ do .add_jobs (jobs )
77+
78+
79+ @main .command ()
80+ @click .option ('--org' ,'-o' ,help = 'Explicitly remove organizations' )
81+ @click .option ('--skill' ,'-s' ,help = 'Remove skills' )
82+ @click .option ('--job' ,'-j' ,help = 'For removing jobs -j <job>' )
83+ def remove (org ,skill ,job ):
84+ """
85+
86+ Remove data from consideration\n
87+ Params:\n
88+ org Type: comma separated string\n
89+ skill Type: comma separated string\n
90+ job Type: comma separated string\n
91+ Usage:\n
92+ For adding organization:\n
93+ cvscan remove --org <org_name,org_name,..>\n
94+ For adding skill:\n
95+ cvscan remove --skill <skill,skill,..>\n
96+ For adding job:\n
97+ cvscan remove --job <job,job,..>\n
98+ The above can be combined together also. Eg:\n
99+ cvscan remove -o <org_name,org_name,..> -s <skill,skill,..> -j <job>
100+ is also valid
101+
102+ """
103+ if org :
104+ do .remove_organizations (org .split (',' ))
105+ if skill :
106+ do .remove_skills (skill .split (',' ))
107+ if job :
108+ do .remove_jobs (job .split (',' ))
0 commit comments