Skip to content

Commit cdb93bb

Browse files
authored
Merge pull request #11 from lakshmanaram/master
Updated Instructions and enhanced entry point efficiency
2 parents 2a321bf + ff04c65 commit cdb93bb

File tree

6 files changed

+2224
-1435
lines changed

6 files changed

+2224
-1435
lines changed

README.md

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,52 @@
11
# cvscan
22
Your not so typical resume parser
3-
4-
53
Instructions
64
========
75
Follow these to have a sneak peek of what's going on
86
1. git clone https://github.com/skcript/cvscan.git
9-
2. cd cvscan/cvscan
10-
3. python cvscan.py
11-
4. Type one of the following: lakshamanram (or) swaathi
7+
2. cd cvscan
8+
3. python setup.py install
9+
4. Place the sample resume in the ~/cvscan folder and enter the file name
10+
or enter relative path
11+
Eg: ~/cvpath/data/sample/a.pdf is parsed by
12+
```bash
13+
cvscan parse --name data/sample/a
14+
```
15+
16+
Data Manipulations
17+
===============
18+
## Skills
19+
Note: Skills are case-sensitive unlike Jobs and Organizations
20+
### add
21+
```
22+
cvscan add -s "C,C++,R,Java"
23+
```
24+
### remove
25+
```
26+
cvscan remove --skill "C,C++"
27+
```
28+
## Jobs
29+
### add
30+
Adding
31+
1. contributor Job-category: Programmer
32+
2. Android Programmer Job-category: Developer
1233

13-
To test on some other resume
14-
1. Place the resume in the data/input folder.
15-
2. Avoid spaces in the file name.
16-
3. Run the instructions above and give the newly added filename as input instead.
34+
```
35+
cvscan add -j "contributor:Programmer,android Programmer:Developer"
36+
```
37+
### remove
38+
Removing
39+
1. contributor
40+
2. Android Programmer
41+
```
42+
cvscan remove --job "contributor,Android Programmer"
43+
```
44+
## Organizations
45+
### add
46+
```
47+
cvscan add --org "Skcript"
48+
```
49+
### remove
50+
```
51+
cvscan remove -o "Skcript"
52+
```

cvscan/cli/cli.py

Lines changed: 82 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# -*- encoding: utf-8 -*-
22
"""
3+
34
Cvscan command line tool
5+
46
"""
57

68
import click
79
import pprint
810

911
from 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')
2327
def 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

Comments
 (0)