-
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a90e211
commit ceb4384
Showing
4 changed files
with
55 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
This module is a script to run the RenderCV and generate a CV as a PDF. It is an entry | ||
point for the RenderCV package. | ||
""" | ||
import os | ||
import logging | ||
import sys | ||
|
||
from rendercv.rendering import read_input_file, render_template, run_latex | ||
|
||
|
||
def main(args=sys.argv[1:]): | ||
""" | ||
This is the main function to run RenderCV. | ||
""" | ||
logger = logging.getLogger(__name__) | ||
|
||
if len(args) != 1: | ||
raise ValueError("Please provide the input file path.") | ||
elif len(args) == 1: | ||
input_file_path = args[0] | ||
else: | ||
raise ValueError( | ||
"More than one input is provided. Please provide only one input, which is" | ||
" the input file path." | ||
) | ||
|
||
input_file_path = sys.argv[1] | ||
file_path = os.path.join(os.getcwd(), input_file_path) | ||
data = read_input_file(file_path) | ||
output_latex_file = render_template(data) | ||
output_pdf_file = run_latex(output_latex_file) | ||
logger.info(f"RenderCV: PDF file generated at {output_pdf_file}") | ||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name="rendercv", | ||
version="1.0", | ||
author="Sina Atalay", | ||
description="A Python package to generate a CV as a PDF from a YAML or JSON file.", | ||
packages=find_packages(), | ||
entry_points={ | ||
"console_scripts": [ | ||
"rendercv = rendercv.cli:main", | ||
] | ||
}, | ||
) |