json_resume 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/bin/json_resume +104 -0
- data/examples/prateek_cv.json +271 -0
- data/extras/resume_html.tar.gz +0 -0
- data/json_resume.gemspec +23 -0
- data/lib/json_resume.rb +6 -0
- data/lib/json_resume/formatter.rb +130 -0
- data/lib/json_resume/formatter_html.rb +32 -0
- data/lib/json_resume/formatter_latex.rb +45 -0
- data/lib/json_resume/formatter_md.rb +21 -0
- data/lib/json_resume/json_resume.rb +19 -0
- data/lib/json_resume/reader.rb +35 -0
- data/lib/json_resume/version.rb +3 -0
- data/spec/json_resume/formatter_html_spec.rb +95 -0
- data/spec/json_resume/formatter_latex_spec.rb +51 -0
- data/spec/json_resume/formatter_spec.rb +68 -0
- data/spec/json_resume/reader_spec.rb +33 -0
- data/spec/spec_helper.rb +6 -0
- data/templates/default_html.mustache +219 -0
- data/templates/default_md.mustache +130 -0
- data/templates/default_tex.mustache +183 -0
- metadata +106 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4d1b1de38c87850a0e8c6e95aa04ddd3ccc4090c
|
4
|
+
data.tar.gz: cf95a44f35862ae27fd91705adafecddd4a47eef
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 164f981adabdd5051bca2e9c26dfa41c1a8a6425ae3f29145d7dcd634943c2c0cab203dbb713c46adb508e3f57b7ab2860e6f144712358855861411fc68f93c0
|
7
|
+
data.tar.gz: 924e7ec24f90d6ac473fcabd0dfb66c5d41afcfbf49efd88c97473f7daaa10b65f730e184dab2da78aad560e4a84bde5b6e3c6cf5c639e5e726167a79b6211cb
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Prateek Agarwal
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# JsonResume
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'json_resume'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install json_resume
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/json_resume
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'thor'
|
4
|
+
require 'mustache'
|
5
|
+
require_relative '../lib/json_resume'
|
6
|
+
require 'archive/tar/minitar'
|
7
|
+
include Archive::Tar
|
8
|
+
require 'zlib'
|
9
|
+
require 'pdfkit'
|
10
|
+
require 'rest-client'
|
11
|
+
|
12
|
+
WL_URL = "https://www.writelatex.com/docs"
|
13
|
+
class JsonResumeCLI < Thor
|
14
|
+
|
15
|
+
desc "convert /path/to/json/file", "converts the json to pretty resume format"
|
16
|
+
option :out, :default=>"html", :banner=>"output_type", :desc=>"html|html_pdf|tex|tex_pdf|md"
|
17
|
+
option :template, :banner=>"template_path", :desc=>"path to customized template (optional)"
|
18
|
+
def convert(json_input)
|
19
|
+
puts "Generating the #{options[:out]} type..."
|
20
|
+
puts send('convert_to_'+options[:out], json_input, get_template(options))
|
21
|
+
end
|
22
|
+
|
23
|
+
desc "sample", "Generates a sample json file in cwd"
|
24
|
+
def sample()
|
25
|
+
cwd = Dir.pwd
|
26
|
+
json_file_paths = Dir["#{@@orig_locn}/../examples/*.json"]
|
27
|
+
json_file_names = json_file_paths.map{|x| File.basename(x)}
|
28
|
+
FileUtils.cp json_file_paths, Dir.pwd
|
29
|
+
msg = "Generated #{json_file_names.join(" ")} in #{cwd}/"
|
30
|
+
msg += "\nYou can now modify it and call: json_resume convert <file.json>"
|
31
|
+
puts msg
|
32
|
+
end
|
33
|
+
|
34
|
+
no_commands do
|
35
|
+
@@orig_locn = File.expand_path(File.dirname(__FILE__))
|
36
|
+
|
37
|
+
def get_template(options)
|
38
|
+
out_type = options[:out].split('_').first #html for both html, html_pdf
|
39
|
+
options[:template] || "#{@@orig_locn}/../templates/default_#{out_type}.mustache"
|
40
|
+
end
|
41
|
+
|
42
|
+
def convert_to_html(json_input, template, dest=Dir.pwd, dir_name='resume')
|
43
|
+
tgz = Zlib::GzipReader.new(File.open("#{@@orig_locn}/../extras/resume_html.tar.gz", 'rb'))
|
44
|
+
Minitar.unpack(tgz, "#{dest}/#{dir_name}")
|
45
|
+
msg = generate_file(json_input, template, "html", "#{dest}/#{dir_name}/page.html")
|
46
|
+
msg += " Place it in /var/www/ to host."
|
47
|
+
end
|
48
|
+
|
49
|
+
def convert_to_html_pdf(json_input, template, dest=Dir.pwd)
|
50
|
+
tmp_dir = ".tmp_resume"
|
51
|
+
convert_to_html(json_input, template, dest, tmp_dir)
|
52
|
+
PDFKit.configure do |config|
|
53
|
+
config.default_options = {
|
54
|
+
:footer_right => "Page [page] of [toPage] .\n",
|
55
|
+
:footer_font_size => 10,
|
56
|
+
:footer_font_name => "Georgia"
|
57
|
+
}
|
58
|
+
end
|
59
|
+
html_file = File.new("#{dest}/#{tmp_dir}/core-page.html")
|
60
|
+
|
61
|
+
pdf_options = {
|
62
|
+
:margin_top => 2.0,
|
63
|
+
:margin_left=> 0.0,
|
64
|
+
:margin_right => 0.0,
|
65
|
+
:margin_bottom => 4.0,
|
66
|
+
:page_size => 'Letter'
|
67
|
+
}
|
68
|
+
kit = PDFKit.new(html_file, pdf_options)
|
69
|
+
|
70
|
+
kit.to_file(dest+"/resume.pdf")
|
71
|
+
FileUtils.rm_rf "#{dest}/#{tmp_dir}"
|
72
|
+
msg = "\nGenerated resume.pdf at #{dest}."
|
73
|
+
end
|
74
|
+
|
75
|
+
def convert_to_tex(json_input, template, dest=Dir.pwd, filename="resume.tex")
|
76
|
+
generate_file(json_input, template, "latex", "#{dest}/#{filename}")
|
77
|
+
end
|
78
|
+
|
79
|
+
def convert_to_tex_pdf(json_input, template, dest=Dir.pwd)
|
80
|
+
#ToDo: Test for presence of pdflatex
|
81
|
+
convert_to_tex(json_input, template, dest, ".tmp_resume.tex")
|
82
|
+
tex_file = File.read("#{dest}/.tmp_resume.tex")
|
83
|
+
RestClient.post(WL_URL, :snip => tex_file, :splash => "none") do |response, req, res, &bb|
|
84
|
+
FileUtils.rm "#{dest}/.tmp_resume.tex"
|
85
|
+
msg = "\nPDF is ready at #{response.headers[:location]}"
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def convert_to_md(json_input, template, dest=Dir.pwd)
|
90
|
+
generate_file(json_input, template, "markdown", "#{dest}/resume.md")
|
91
|
+
end
|
92
|
+
|
93
|
+
def generate_file(json_input, template, output_type, dest)
|
94
|
+
resume_obj = JsonResume.new(json_input, "output_type" => output_type)
|
95
|
+
mustache_obj = Mustache.render(File.read(template), resume_obj.reader.hash)
|
96
|
+
File.open(dest,'w') {|f| f.write(mustache_obj) }
|
97
|
+
return "\nGenerated files present at #{dest}"
|
98
|
+
end
|
99
|
+
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
103
|
+
|
104
|
+
JsonResumeCLI.start(ARGV)
|
@@ -0,0 +1,271 @@
|
|
1
|
+
{
|
2
|
+
"firstname": "Prateek",
|
3
|
+
"familyname": "Agarwal",
|
4
|
+
"linkedin_id": "prat0318",
|
5
|
+
"github_id": "prat0318",
|
6
|
+
"bio_data": {
|
7
|
+
"email": "prat0318 @ cs.utexas.edu",
|
8
|
+
"phone": "+1 (512) 698-3649",
|
9
|
+
"website": "http://prat0318.github.io",
|
10
|
+
"stars": ["Ruby","Python","Git","Cartooning"],
|
11
|
+
"summary": {
|
12
|
+
"points":[
|
13
|
+
"Competent at managing responsibilities in a high-volume atmosphere",
|
14
|
+
"Hard worker, quick learner, and ability to assume responsibility"
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"github_projects": {
|
18
|
+
"details": [
|
19
|
+
{
|
20
|
+
"project_name": "prat0318/2048-tetris",
|
21
|
+
"tagline": "Live at [2048-tetris.com](http://2048-tetris.com)",
|
22
|
+
"description": [
|
23
|
+
"Wrote a Tetris variant of 2048 game, 1M+ unique visits",
|
24
|
+
"Made it to the front page of Hacker News for a day(~150 pts), mentioned in TechCrunch."
|
25
|
+
]
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"project_name": "prat0318/gitator",
|
29
|
+
"tagline": "Live at [Gitator.com](http://gitator.com)",
|
30
|
+
"description": [
|
31
|
+
"Finds relevant repositories based on an user's GitHub profile.",
|
32
|
+
"Written in Ruby on Sinatra and uses Github's Octokit gem"
|
33
|
+
]
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"project_name": "prat0318/json_resume",
|
37
|
+
"tagline": "Convert JSON data to pretty resumes in .html, .tex, .md",
|
38
|
+
"description": [
|
39
|
+
"Static personal page and resume design using Mustache.",
|
40
|
+
"Current resume is generated using json_resume."
|
41
|
+
]
|
42
|
+
}
|
43
|
+
]
|
44
|
+
},
|
45
|
+
"skills": {
|
46
|
+
"details": [
|
47
|
+
{
|
48
|
+
"type": "Programming Languages",
|
49
|
+
"items": [
|
50
|
+
"Ruby",
|
51
|
+
"Python",
|
52
|
+
"Java",
|
53
|
+
"C++",
|
54
|
+
"Javascript",
|
55
|
+
"PHP"
|
56
|
+
]
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"type": "Web Frameworks",
|
60
|
+
"items": [
|
61
|
+
"Sinatra",
|
62
|
+
"Django",
|
63
|
+
"Rails",
|
64
|
+
"Apache"
|
65
|
+
]
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"type": "Databases",
|
69
|
+
"items": [
|
70
|
+
"MySQL",
|
71
|
+
"PostgreSQL",
|
72
|
+
"IBM Informix",
|
73
|
+
"IBM DB2"
|
74
|
+
]
|
75
|
+
}
|
76
|
+
]
|
77
|
+
},
|
78
|
+
"education": {
|
79
|
+
"show_gpa": true,
|
80
|
+
"schools": [
|
81
|
+
{
|
82
|
+
"degree": "Master of Science",
|
83
|
+
"major": "Computer Science",
|
84
|
+
"institution": "University of Texas at Austin",
|
85
|
+
"graduation_year": 2015,
|
86
|
+
"gpa": "3.55/4"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"degree": "Bachelor of Technology (Hons.)",
|
90
|
+
"major": "Computer Science",
|
91
|
+
"institution": "Indian Insitute of Technology, Kharagpur (IN)",
|
92
|
+
"graduation_year": 2009,
|
93
|
+
"gpa": "8.91/10"
|
94
|
+
}
|
95
|
+
]
|
96
|
+
},
|
97
|
+
"acad_achievements": {
|
98
|
+
"items": [
|
99
|
+
"Was among the top 5% in the institute merit list of the undergraduate batch at IIT Kharagpur.",
|
100
|
+
"Secured 383rd Rank in IIT-JEE 2005, an exam conducted by Indian Institute of Technology(s)."
|
101
|
+
]
|
102
|
+
},
|
103
|
+
"experience": {
|
104
|
+
"items": [
|
105
|
+
{
|
106
|
+
"title": "Graduate Research Assistant",
|
107
|
+
"organisation": "CTR, UT Austin",
|
108
|
+
"location": "",
|
109
|
+
"from": "Sept. 2013",
|
110
|
+
"to": "Jan. 2014",
|
111
|
+
"details": [
|
112
|
+
"Developed a common web interface <<http://unitydatabase.com>> to search through different datasets and output aggregate results and ensuring easy pluggability of new datasets."
|
113
|
+
],
|
114
|
+
"technology_used": {
|
115
|
+
"tools": [
|
116
|
+
"Python",
|
117
|
+
"Django",
|
118
|
+
"South",
|
119
|
+
"PostgreSQL"
|
120
|
+
]
|
121
|
+
}
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"title": "SDE II (Software Development Engineer II)",
|
125
|
+
"organisation": "Flipkart",
|
126
|
+
"location": "India",
|
127
|
+
"from": "Apr. 2013",
|
128
|
+
"to": "Jul. 2013",
|
129
|
+
"details": [
|
130
|
+
"Wrote a ruby gem _Morsel_ to traverse through active record trees to purge old records. It helped in limiting the production database size and keeping the data clean."
|
131
|
+
]
|
132
|
+
},
|
133
|
+
{
|
134
|
+
"title": "Software Development Engineer",
|
135
|
+
"organisation": "Flipkart",
|
136
|
+
"location": "India",
|
137
|
+
"from": "Jun. 2011",
|
138
|
+
"to": "Mar. 2013",
|
139
|
+
"details": [
|
140
|
+
"Was part of a team which developed the warehouse module in RoR framework from scratch. It now scales to around 10X as compared to the ERP system existed.",
|
141
|
+
"Designed warehouse stock snapshots and stock ledger framework using Pig scripts to make the supply chain system legally compliant."
|
142
|
+
],
|
143
|
+
"technology_used": {
|
144
|
+
"tools": [
|
145
|
+
"Ruby",
|
146
|
+
"Java",
|
147
|
+
"Pig",
|
148
|
+
"Active Records",
|
149
|
+
"MySQL"
|
150
|
+
]
|
151
|
+
}
|
152
|
+
},
|
153
|
+
{
|
154
|
+
"title": "Software Engineer",
|
155
|
+
"organisation": "IBM Software Labs",
|
156
|
+
"location": "India",
|
157
|
+
"from": "Jul. 2009",
|
158
|
+
"to": "Jun. 2011",
|
159
|
+
"details": [
|
160
|
+
"Handled high priority issues for JDBC client driver for IBM Informix database.",
|
161
|
+
"Was awarded Smart CADian award for resolving an obscure deadlock situation, making Informix JDBC driver more robust."
|
162
|
+
],
|
163
|
+
"technology_used": {
|
164
|
+
"tools": [
|
165
|
+
"Java",
|
166
|
+
"IBM Informix",
|
167
|
+
"IBM DB2"
|
168
|
+
]
|
169
|
+
}
|
170
|
+
}
|
171
|
+
]
|
172
|
+
},
|
173
|
+
"other_projects": {
|
174
|
+
"items": [
|
175
|
+
{
|
176
|
+
"headline": "Designed product _Omerta_, a multi-user chat room application in j2me using Sun Wireless Toolkit platform.",
|
177
|
+
"points": [
|
178
|
+
"Was awarded 1<sup>st</sup> position for the product in [Envision](http://www.ecell-iitkgp.org/envision.php), Product Innovation Contest, IIT KGP.",
|
179
|
+
"Was awarded 1<sup>st</sup> position for the product in Javawise, J2ME s/w Development Contest at IIT Kharagpur, 2008 and 2009 continuously."
|
180
|
+
]
|
181
|
+
}
|
182
|
+
]
|
183
|
+
},
|
184
|
+
"grad_courses": [
|
185
|
+
{
|
186
|
+
"name": "Distributed Computing",
|
187
|
+
"url": "http://www.cs.utexas.edu/users/lorenzo/corsi/cs380d/13F/"
|
188
|
+
},
|
189
|
+
{
|
190
|
+
"name": "Feature Oriented Programming",
|
191
|
+
"url": "http://www.cs.utexas.edu/users/dsb/cs392f"
|
192
|
+
},
|
193
|
+
{
|
194
|
+
"name": "Multicore Programming",
|
195
|
+
"url": "http://www.cs.utexas.edu/~pingali/CS395T/2013fa"
|
196
|
+
}
|
197
|
+
],
|
198
|
+
"undergrad_courses": [
|
199
|
+
{
|
200
|
+
"name": "Network Systems",
|
201
|
+
"url": "http://www.facweb.iitkgp.ernet.in/~agupta/netlab/"
|
202
|
+
},
|
203
|
+
{
|
204
|
+
"name": "Graph Theory",
|
205
|
+
"url": "http://cse.iitkgp.ac.in/~agupta/graph/"
|
206
|
+
}
|
207
|
+
],
|
208
|
+
"research_experience": {
|
209
|
+
"items": [
|
210
|
+
{
|
211
|
+
"title":"Undergraduate project",
|
212
|
+
"organisation": "Sanyog Lab, IIT Kharagpur",
|
213
|
+
"from": "Jul. 2008",
|
214
|
+
"to": "May 2009",
|
215
|
+
"points": [
|
216
|
+
"Designing and Formal modelling of embedded systems for project Sanyog.",
|
217
|
+
"Skills Developed: Low level system design, theorem verification using Prolog and Coq"
|
218
|
+
]
|
219
|
+
},
|
220
|
+
{
|
221
|
+
"title":"Summer Intern",
|
222
|
+
"organisation": "Network Systems Lab, IIT Kharagpur",
|
223
|
+
"from": "May 2008",
|
224
|
+
"to": "Jun. 2008",
|
225
|
+
"points": [
|
226
|
+
"Design and simulation of currently published Pull-based Freshness Schemes in C++."
|
227
|
+
]
|
228
|
+
},
|
229
|
+
{
|
230
|
+
"title":"Summer Intern",
|
231
|
+
"organisation": "Telemedicine Lab, IIT Kharagpur",
|
232
|
+
"from": "May 2007",
|
233
|
+
"to": "Jun. 2007",
|
234
|
+
"points": [
|
235
|
+
"Web based medical image browsing and annotation tools for PDA devices in .NET platform."
|
236
|
+
]
|
237
|
+
}
|
238
|
+
]
|
239
|
+
},
|
240
|
+
"extra_curricular": {
|
241
|
+
"items": [
|
242
|
+
"Was awarded 2<sup>nd</sup> position in Bionetics, Coding Event, Genesis 09 at IIT Kharagpur.",
|
243
|
+
"Microsoft Student Partner of IIT Kharagpur from the period July 08 – June 09."
|
244
|
+
]
|
245
|
+
},
|
246
|
+
"papers": {
|
247
|
+
"items": [
|
248
|
+
{
|
249
|
+
"authors":"Michl Dugls, Mrclo Dsconi",
|
250
|
+
"title":"Some exotic dummy title like potentials arising from string compactifications",
|
251
|
+
"misc":"arXiv: 1206.1885, June 2012"
|
252
|
+
}
|
253
|
+
]
|
254
|
+
},
|
255
|
+
"patents": {
|
256
|
+
"items": [
|
257
|
+
{
|
258
|
+
"patent_id":"US Patent X,XXX,634",
|
259
|
+
"url":"",
|
260
|
+
"issuance_date":"September 15, 1992",
|
261
|
+
"title":"Another exotic title like bed cover with an inflatable human form."
|
262
|
+
}
|
263
|
+
]
|
264
|
+
},
|
265
|
+
"memberships": {
|
266
|
+
"committees": [
|
267
|
+
"Member of the ACM awesomest humans secret group, 2008-present"
|
268
|
+
]
|
269
|
+
}
|
270
|
+
}
|
271
|
+
}
|