diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de12afb --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +dist +colorconverters.egg-info +build +*.egg-info +venv +.venv +.idea/ +.vs/slnx.sqlite +env/ +test.py +.env \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f1938fa --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,30 @@ +# Changelog + +Based on KeepAChangelog. +Generated by **Documatic.** + +## Unreleased + +## 0.2.1 - 2022-01-19 + +## 0.1.3 - 2022-01-19 + +## 0.1.1 - 2022-01-19 + +## 0.1.0 - 2022-01-19 + +## show - 2022-01-19 + +### Added + +* Business card generator and resume generator script. + +### Fixed + +* Bug in readme.rst. +* Some bugs +* Path bug and changed resume generator a bit + +### Removed + +* .env diff --git a/README.md b/README.md deleted file mode 100644 index b535ffc..0000000 --- a/README.md +++ /dev/null @@ -1,71 +0,0 @@ -# Documatic presents to you our 2nd hackathon!! - -### Table Of Content 📃 - -- [What's a hackathon?](https://github.com/DocumaticAI/Hackathon#whats-a-hackathon--) -- [How to participate](https://github.com/DocumaticAI/Hackathon#cool-how-do-i-participate-) -- [Topic](https://github.com/DocumaticAI/Hackathon#whats-the-topic-) -- [Rules](https://github.com/DocumaticAI/Hackathon#rules-) -- [Criteria of Judgement](https://github.com/DocumaticAI/Hackathon#criteria-of-judgement-) -- [Prizes](https://github.com/DocumaticAI/Hackathon#prizes-) -- [Support/dispute/inquiry](https://github.com/DocumaticAI/Hackathon/blob/master/README.md#support--dispute--inquiry-) -
- -## What's a hackathon? hmmm - - -We'll give you a topic and you have to create projects on it, The best ones will win!! You can have upto 3 collaborators (teammates) to help you with it. - -
- -## Cool!! How do I participate? kool - -Steps on how to participate: - -- Join our [community server](https://discord.gg/BcbY3GXtUZ) and provide the following details in team-details channel: language in use, real/discord name, email, github username, teammates -- Fork this repository -- create your project on your fork inside the [src folder](https://github.com/DocumaticAI/Hackathon/tree/master/src) -- create a pull request with the [template](https://github.com/DocumaticAI/Hackathon/blob/master/.github/pull_request_template.md) - -
- -## What's the topic? konfused - -there isnt one! Go crazy!! make anything you want, just make it unique. ***The project should be made only using js/ts or python. html/css are allowed.*** - -
- -## Rules rools - -- The project should be made only using js/ts or python. html/css are allowed. -- All projects must be fresh, reusing old code is not allowed. -- All teams should be registered in our discord server. Provide the following details in team-details channel: language in use, real name, email, github username, teammates -- Python projects are required to use Documatic tool to document their code. [How to use Documatic Tool](https://github.com/DocumaticAI/Hackathon/blob/master/examples/technical-docs.md) -- All projects are required to use doculog tool to document their commits. [How to use Doculog](https://github.com/DocumaticAI/Hackathon/blob/master/examples/doculog.md) -- All projects are supposed to be submitted by 18th January, 00:00 EST time. -- No copying someone else's code, we can check the time on each fork's commit history to determine who copied and will be disqualified. - -
- -## Criteria of judgement monkeyjudge - -Projects will be marked on the bases of creativity, uniqueness, functionality, overall code quality and file structure. - -
- -## Prizes geft - -Ofc!! No hackathon is complete without rewarding the people participating in it :) - - - - 1st place = 100$
- - 2nd place = 60$
- - 3rd place = 40$
- - 4th place = 25$
- - 5th place = 25$
- -
- -## support / dispute / inquiry geft - -Join our Discord Server or open an issue on this repository, you're more likely to recieve a faster answer on the server. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..15e761b --- /dev/null +++ b/README.rst @@ -0,0 +1,69 @@ +businesstemplates +================= + +.. image:: https://img.shields.io/pypi/v/businesstemplates.svg + :target: https://pypi.python.org/pypi/businesstemplates + :alt: PyPI version info +.. image:: https://img.shields.io/pypi/pyversions/businesstemplates.svg + :target: https://pypi.python.org/pypi/businesstemplates + :alt: PyPI supported Python versions + +An efficient command line tool to create resumes and business cards on the go! + +Notable Features +---------------- + +- Modern pythonic syntax. +- Easy to run scripts. +- Covers all important information. +- Lightweight module. + +Installing +---------- + +**"Python 3.7" or higher is required to install this module.** + +Installing this module is quite simple, + +.. code:: sh + + # Linux/macOS + python3 -m pip install -U businesstemplates + + # Windows + py -3 -m pip install -U businesstemplates + +Other Required Packages +~~~~~~~~~~~~~~~~~~~~~~~~ + +* `python-docx `__ +* `pathlib` + +How to run? +----------- + +Resume Generator +~~~~~~~~~~~~~~~~ + +Now you can design your own impressive resume + +Open your favourite terminal and enter this + +.. code:: sh + + resume_generator + +Enter the information through the inputs and you're done! + +Business Card Generator +~~~~~~~~~~~~~~~~~~~~~~~ + +Design your sparkling business card in just under a minute. + +Open your favourite terminal and enter this + +.. code:: sh + + business_card_generator + +Enter the information through the inputs and you're done! diff --git a/examples/doculog.md b/examples/doculog.md deleted file mode 100644 index 3e9ab0f..0000000 --- a/examples/doculog.md +++ /dev/null @@ -1,241 +0,0 @@ -# doculog - -## [Demo Video](https://youtu.be/zpPjkhckFMQ) - - -_README generated with **Documatic**_. - -Quickly generate changelogs -and release notes -by analysing your git history. -A tool written in python, -but works on any language. - -## Getting started - -### Requirements - -* python >= 3.8 -* git -* "good" commit messages -* Git version tags - -Minimum python 3.8. -Project actively supports python 3.8, -3.9, -3.10. -To install, -clone the repository -and run `pip install -e .` -to package locally -OR -`pip install doculog`. - -`Doculog` works by reading git commit messages -and inferring what changes are being made. -It assumes that you are writing -your commit messages as actions: -e.g. "_Add_ some feature", -"_Fix_ a particular bug". -While it's good practice to have the action -in the present, -imperitive tense, -`doculog` accepts past verbs. -See [git best practices](https://cbea.ms/git-commit/#imperative) -for more information -on this git commit writing style. -Standard `doculog` looks through a list -of expected verbs -(open an issue/contribute a PR if there are some missing!), -but the [extended version](#api-key) -includes additional logic -for classifying commit message, -which allows you to be more lax -with your commit messages. - -### API key - -To generate a changelog -with a full feature-set, -doculog requires a (free) -API key. -Join the waitlist -for an API key -by joining our [discord server](https://discord.gg/BcbY3GXtUZ) -In the meantime, -doculog **works without an API key** -(you just won't have access to advanced features). - -`doculog` uses `python-dotenv` -to load environment variables -stored in a `.env` file. -To use your API key, -create a `.env` file -in your project root directory -with the following fields: - -``` -DOCUMATIC_API_KEY = -``` - -**IMPORTANT: DO NOT ADD `.env` TO VERSION CONTROL. -YOUR API KEY MUST BE KEPT SECRET.** - - -### Generate a Changelog - -In a terminal, -run `doculog` -to create -a `CHANGELOG.md` -from your git commit history, -or update an existing changelog. -The "Unreleased" section corresponds to updates -not attached to a version. -Each changelog update version -may contain the following sections: -"Added", -"Removed", -"Deprecated", -"Fixed", -"Changed". -Each section header will only appear -in the version -if it has at least one update. -**Note:** `doculog` will overwrite changes made -to the "Unreleased" section -every time it is run, -however tagged versions are not overwritten. -Therefore, -you can manually edit -and add updates -to a version release. - -To get the best out of the changelog, -read the concepts below -for information on -[configuration](#configuration), -[git commits](#git-commit-parsing) -and [version tags](#version-tags). - -## Concepts - -### Git commit parsing - -The initial logic for generating a changelog -comes from reading -your git commit messages. -`doculog` -expects -commit messages to begin with an imperitive verb, -and to written passively. -`doculog` parses the message for signalling words -and phrases. - -E.g. `Rename 'my_func' to 'my_awesome_func'` -will get interpreted as a "Changed" feature. -Whereas `'my_func' -> 'my_awesome_func'` -will not. - -### Version tags - -Changelogs break down your project's featureset -by each release. -Currently, -`doculog` infers a release has been made -by reading the git tags of your project. -If you don't have any git tags, -your changelog will only have an "Unreleased" section. -To make a git tag, -run `git tag -a v--` -(and `git push --tags` to push to your remote); -This assumes you're using [semver](https://www.mariokandut.com/what-is-semantic-versioning-semver/) -versioning system. - -**Note:** not using semver or git tags to release your project? -Open an issue on the `doculog` repo -detailing your method to get it supported -by `doculog`. - -### Configuration - -You can configure how `doculog` runs -by adding a `tool.doculog` section -to `pyproject.toml`. - -| Field | Purpose | Required | Default value | -|:------|:--------|:---------|:--------------| -| changelog | Name of changelog file generated. ".md" suffix added if not present. | No | CHANGELOG.md | -| project | The name of your project. Used to title the changelog | No | The name of your root project folder | -| local | If `true`, use a local sever for advanced features. Only used for project development | No | false | - -For example, -your `pyproject.toml` file _might_ be: - -``` -[tool.doculog] -changelog = "CHANGELOG" -project = "My Cool Project" -``` - -## Developers - -Read the [contributing guide](CONTRIBUTING.md) -for information on coding styles -and workflow. - -Run `pip install -r requirements-dev.txt` -to get developer requirements. - -| CI file | Purpose | -|:--------|:--------| -| `test.yml` | Linting and unit testing. Runs on every pull request | - -## FAQ - -### I want more intelligent featureset generation. What can I do? - -Request access to the free Documatic API -to generate a changelog -driven by machine learning. -Follow `Documatic` on GitHub -and socials -to stay up to date -with the latest features -and releases. - -### How do I get my API key? - -Once you've joined the waitlist, -we will be in touch shortly -with your API key. - -### The changelog is great, but I want more! - -Get in touch - `info@documatic.com`. - -### I'm not getting a complete changelog. What's gone wrong? - -Check that you have appropriate [version tags](#version-tags) -and [commit messages](#git-commit-parsing). -If you have the advanced featureset -(i.e. have an API key) -then you will get better changelog updates -which don't require you to follow -the commit process -so strictly. -If you're still not getting good results, -please open a bug report. - -### Can I contribute to doculog? - -Absolutely: -feature requests, -bug fixes, -bug reports -and PRs of all shapes and sizes -are welcome. -See the [developers](#developers) -section. - -_Generated by **Documatic**._ \ No newline at end of file diff --git a/examples/technical-docs.md b/examples/technical-docs.md deleted file mode 100644 index 6e8fccb..0000000 --- a/examples/technical-docs.md +++ /dev/null @@ -1,125 +0,0 @@ -# Technical Docs - -## [Demo video](https://www.youtube.com/watch?v=m6Oo3HRY9IY) - -# API key - -To use all features of Documatic tools, you will need to get a (free) API key. All hackathon participants get a free key, join our [discord server](https://discord.gg/BcbY3GXtUZ) - -To use your API key, create a “.env” file in the root of a project you wish to document, and give it the following field: -``` - DOCUMATIC_API_KEY = -``` -**DO NOT ADD THE .env FILE TO SOURCE CONTROL. DO NOT SHARE YOUR API KEY WITH ANYONE.** - -
- -# Technical Docs - -Documatic automatically generates technical documentation for your codebase. For parts of your documentation which have not yet been automated, Documatic provides helpful features to streamline how you create and maintain great documentation. Documents are currently generated in a markdown format, however other formats and hosting options are coming soon. - -
- -# Configuration - -Create a “pyproject.toml” file in the root directory. -Give it a section “tool.documatic”. The following fields must be filled: - -- name -- - The name of your project -- docdir -- - The path to the folder in which you want documentation to be generated. The folder must exist. Set as “.” to be your project root -- srcdir -- - The path to the source code directory. E.g. if your project structure is “root/src/mypackage/init.py”, then “srcdir” would be “src/mypackage” - -Additionally, there are some optional fields you may use: - -- package -- - The name of your codebase as a python package, as it would be imported around the codebase or in other projects -- - Only relevant if codebase is pip-installable and you don’t use relative imports -- - Defaults to “srcdir”, so only necessary if import package name differs -- - E.g. if structure is “root/src/mypackage/__init__.py” then srcdir would be “src/mypackage” and package would probably be “mypackage” -- docname -- - The name of the technical document to be generated -- - Defaults to “technical_doc” -- - “.md” extension will be appended to the end if not provided - -
- -## Getting the tool - -If you use VSCode, search for and install the “Documatic” extension. Otherwise, install the “documatic” python package with “pip install documatic”. - -The VSCode extension is the preferred method as it provides additional features for generating documentation. - -
- -## Generating Documentation - -### If using the VSCode extension: - -- 1. In a terminal, navigate to the directory of the project - -- 2. you wish to document - -- 3. Open it with “code .” - -- 4. Press “ctrl + shift + p” to open the command pane - -- 5. Search for and run “Generate Technical Documentation” -(Depending on the size of your codebase) Your documentation will be generated in seconds - -N.b. it’s necessary to close all existing VScode windows before using the tool and to navigate directly to your project because of a known bug. This is in the process of being fixed, which will give you more freedom in using the extension. - -### If using the python package: -- 1. In a terminal, navigate to the directory of the project you wish to document -- 2. Run “documatic” -- 3. (Depending on the size of your codebase) Your documentation will be generated in seconds - -
- -## Adding manually edited sections -To include custom sections in your documentation that are not changed by the doc generation process, write the text in your document, highlight it and run the command “Fix Section to Top” (to pin the section to the top of the document) or “Fix Section to Bottom”. Fixing custom sections to anyplace in the document is coming soon. N.b. that if you have at least 1 top-fixed section, Documatic will not generate the intro header when you next run the tool as it assumes that the top fixed section is an intro. You can have as many fixed sections as you like. - -If you don’t have the extension, you can achieve this functionality manually by wrapping the section in markdown comments of the form: -``` - \ No newline at end of file diff --git a/src/README.rst b/src/README.rst new file mode 100644 index 0000000..1fd14fc --- /dev/null +++ b/src/README.rst @@ -0,0 +1,70 @@ +businesstemplates +================= + +.. image:: https://img.shields.io/pypi/v/businesstemplates.svg + :target: https://pypi.python.org/pypi/businesstemplates + :alt: PyPI version info +.. image:: https://img.shields.io/pypi/pyversions/businesstemplates.svg + :target: https://pypi.python.org/pypi/businesstemplates + :alt: PyPI supported Python versions + +An efficient command line tool to create resumes and business cards on the go! + +Notable Features +---------------- + +- Modern pythonic syntax. +- Easy to run scripts. +- Covers all important information. +- Lightweight module. + +Installing +---------- + +**"Python 3.7" or higher is required to install this module.** + +Installing this module is quite simple, + +.. code:: sh + + # Linux/macOS + python3 -m pip install -U businesstemplates + + # Windows + py -3 -m pip install -U businesstemplates + +Other Required Packages +~~~~~~~~~~~~~~~~~~~~~~~~ + +* `python-docx `__ +* `pathlib` + +How to run? +----------- + +Resume Generator +~~~~~~~~~~~~~~~~ + +Now you can design your own impressive resume + +Open your favourite terminal and enter this + +.. code:: sh + + resume_generator + +Enter the information through the inputs and you're done! + +Business Card Generator +~~~~~~~~~~~~~~~~~~~~~~~ + +Design your sparkling business card in just under a minute. + +Open your favourite terminal and enter this + +.. code:: sh + + business_card_generator + +Enter the information through the inputs and you're done! + diff --git a/src/VERSION.txt b/src/VERSION.txt new file mode 100644 index 0000000..afaf360 --- /dev/null +++ b/src/VERSION.txt @@ -0,0 +1 @@ +1.0.0 \ No newline at end of file diff --git a/src/businesstemplates/__init__.py b/src/businesstemplates/__init__.py new file mode 100644 index 0000000..b5c5998 --- /dev/null +++ b/src/businesstemplates/__init__.py @@ -0,0 +1,18 @@ +""" +Business Templates +=================== + +An efficient command line tool to create resumes and business cards on the go! + +Copyright 2022 (c) That GenZ Gamer +This project uses the MIT license. +""" + +__title__ = "businesstemplates" +__author__ = "That GenZ Gamer" +__license__ = "MIT" +__copyright__ = "Copyright 2022 (c) That GenZ Gamer" +__version__ = "1.0.0" + +from .resume_generator import * +from .business_card_generator import * diff --git a/src/businesstemplates/business_card_generator.py b/src/businesstemplates/business_card_generator.py new file mode 100644 index 0000000..aa4901b --- /dev/null +++ b/src/businesstemplates/business_card_generator.py @@ -0,0 +1,138 @@ +""" +Copyright (c) 2022 That GenZ Gamer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the “Software”), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +""" + +from easy_pil import Editor, Canvas, Font, Text +from pathlib import Path + + +def main(): + + print("--------------------------------") + print(" Business Card Generator ") + print(" ----------------------- ") + print(" Get your sparkling ") + print(" business card ready. ") + print("--------------------------------\n") + + # Getting the path of all the icons and template. + template_dir = Path(__file__).parent / "templates" + email_icon_path = template_dir / "Email Icon Template.png" + phone_icon_path = template_dir / "Phone Icon Template.png" + card_template_path = template_dir / "Business Card Template.jpg" + + # Asking for the inputs + company = input("What company are you working for?: ") + name = input("What's your name?: ") + designation = input("What is your current designation?: ") + department = input("What department are you working in?: ") + phone = input("What's your phone number?: ") + email = input("What's your Email ID?: ") + + # Preparing a while loop to check if the address (Line 1) is below or above 30 characters + address_loop_one = True + + # Resuming if address is below 30 characters. + while address_loop_one: + address_line_1 = input("What's your address? (Line 1) [Max: 30 chars]: ") + if len(address_line_1) <= 30: + address_loop_one = False + else: + print("Limit the length of the address below 30 characters!") + + # Preparing a while loop to check if the address (Line 2) is below or above 30 characters + address_loop_two = True + + # Resuming if address is below 30 characters. + while address_loop_two: + address_line_2 = input("What's your address? (Line 2) [Max: 30 chars]: ") + if len(address_line_2) <= 30: + address_loop_two = False + else: + print("Limit the length of the address below 30 characters!") + + # Background of the canvas. + # Open the background as a new Editor to work on it. + background = Editor(str(card_template_path)) + + # Setting up all the fonts required. + bold_50 = Font.poppins(variant="bold", size=50) + regular_40 = Font.poppins(variant="regular", size=40) + regular_30 = Font.poppins(variant="regular", size=30) + light_25 = Font.poppins(variant="light", size=25) + bold_35 = Font.poppins(variant="bold", size=35) + light_15 = Font.poppins(variant="light", size=15) + + # Loading all the images + phone_icon = Editor(str(phone_icon_path)).resize((30, 30)) + email_icon = Editor(str(email_icon_path)).resize((30, 30)) + + # Adding the texts. + background.text( + (800, 50), company, font=bold_35, color="#000000", align="right" + ) + + background.text( + (800, 90), address_line_1, font=light_15, color="#000000", align="right" + ) + + background.text( + (800, 110), address_line_2, font=light_15, color="#000000", align="right" + ) + + background.text((94, 50), name, font=bold_50, color="#000000") + + background.text( + (94, 196), f"{designation},", font=light_25, color="#000000" + ) + + background.text( + (94, 225), f"{department}", font=light_25, color="#000000" + ) + + # Adding a line for aesthetics. + background.rectangle((94, 159), width=754, height=3, color="#000000") + + # Adding the phone icon + background.paste(phone_icon, (94, 287)) + + # Adding the phone number as text + background.text((148, 290), phone, font=regular_30, color="#000000") + + # Adding the email icon + background.paste(email_icon, (94, 330)) + + # Adding the email ID as text + background.text((148, 335), email, font=regular_30, color="#000000") + + # Asking for the path to save the resulting file. + path_to_save = input( + "Where do you want to save the file? (Eg: C:/path/to/save/filename.png) [Note: Relative paths are also allowed]: " + ) + try: + background.save(path_to_save) + except: + print("You have entered an incorrect path! Try again") + exit() + +# Running the script with the __name__ == "__main__" check. +if __name__ == "__main__": + main() diff --git a/src/businesstemplates/resume_generator.py b/src/businesstemplates/resume_generator.py new file mode 100644 index 0000000..7cff1b9 --- /dev/null +++ b/src/businesstemplates/resume_generator.py @@ -0,0 +1,744 @@ +""" +Copyright (c) 2022 That GenZ Gamer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the “Software”), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +""" + +from docx import Document +from docx.text.paragraph import Paragraph +from docx.shared import Pt +from .utils import change_text, find_paragraph, insert_paragraph_after +from pathlib import Path + + +def main(): + # Prepare a nice (custom) ASCII art to show before the start of the inputs. + print("--------------------------------") + print("| Python Resume Generator |") + print("| ----------------------- |") + print("| Now, you can design your own |") + print("| impressive resume. |") + print("--------------------------------\n") + + template_directory = Path(__file__).parent / "templates" + resume_template = template_directory / "Resume Template.docx" + + # Reading the document containing the resume template. + document = Document(resume_template) + + # The following set of inputs is to get enough information to prepare the resume. + + # Getting the user's name + name = input("What is your full name?: ") + + # Changing the text of the user's name and setting the font size using an helper function. + if len(name) != 0: + change_text(document.paragraphs[0], name, 18, True) + else: + print("You haven't mentioned a name!") + exit() + + # Getting the information table from the word document. + information_table = document.tables[0] + + # Asking for the user's age + age = input("What is your age?: ") + + # Changing the text of the user's age and setting the font size using an helper function. + if len(age) != 0: + age_cell = information_table.columns[0].cells[0].paragraphs[0] + + change_text(age_cell, f"Age: {age}", 12) + else: + print("You haven't mentioned an age!") + exit() + + # Asking for the user's gender + gender = input("What is your gender?: ") + + # Changing the text of the user's gender and setting the font size using an helper function. + if len(gender) != 0: + gender_cell = information_table.columns[0].cells[1].paragraphs[0] + + change_text(gender_cell, f"Gender: {gender}", 12) + else: + print("You haven't mentioned a gender!") + exit() + + # Asking for the user's nationality + nationality = input("Which country do you belong to?: ") + + # Changing the text of the user's nationality and setting the font size using an helper function. + if len(nationality) != 0: + nationality_cell = information_table.columns[0].cells[2].paragraphs[0] + + change_text(nationality_cell, f"Nationality: {nationality}", 12) + else: + print("You haven't mentioned a nationality!") + exit() + + # Asking for the user's Email ID + email = input("What is your Email ID?: ") + + # Changing the text of the user's Email ID and setting the font size using an helper function. + if len(email) != 0: + email_cell = information_table.columns[1].cells[0].paragraphs[0] + + change_text(email_cell, f"Email ID: {email}", 12) + else: + print("You haven't mentioned an Email ID!") + exit() + + # Asking for the user's Mobile no + mobile_number = input("What is your mobile number?: ") + + # Changing the text of the user's mobile no and setting the font size using an helper function. + if len(mobile_number) != 0: + mobile_number_cell = information_table.columns[1].cells[1].paragraphs[0] + + change_text(mobile_number_cell, f"Mobile No: {mobile_number}", 12) + else: + print("You haven't entered a mobile number") + exit() + + # Asking for the user's city + city = input("Which city are you from?: ") + + # Changing the text of the user's mobile no and setting the font size using an helper function. + if len(city) != 0: + city_cell = information_table.columns[1].cells[2].paragraphs[0] + + change_text(city_cell, f"City: {city}", 12) + else: + print("You haven't mentioned a city!") + exit() + + # Asking for the user's address + address = input("What's your address?: ") + + # Changing the text of the user's address and setting the font size using an helper function. + if len(address) != 0: + address_cell = information_table.rows[3].cells[0].paragraphs[0] + + change_text(address_cell, f"Address: {address}", 12) + else: + print("You haven't mentioned an address!") + + # Asking for the user's introduction + objective = input("Write your objective to be mentioned in the resume: ") + + # Changing the text of the user's objective and setting the font size using an helper function. + if len(objective) != 0: + change_text(document.paragraphs[3], objective, 12) + else: + print("You haven't mentioned your objective!") + exit() + + # Getting the course details table + course_details = document.tables[1] + + # Asking for the highest qualification + highest_qualification = input( + "What is your highest qualification? [Post Graduation/Graduation/Class 12/Class 10]: " + ).lower() + + qualifications = [ + "post graduation", + "graduation", + "class 12", + "class 10", + ] + + # Exitting if the qualification selected does not exist in options. + if highest_qualification not in qualifications: + print("Pick an option from the given options!") + exit() + # Exitting if the user hasn't entered anything. + elif len(highest_qualification) == 0: + print("You haven't mentioned your highest qualification!") + else: + # Asking for pg, ug, 12th and 10th details if user is an post graduate. + if highest_qualification == "post graduation": + postgraduate_pg_institute = input( + "Which institute did you pursue your post graduation in?: " + ) + + change_text( + course_details.columns[1].cells[1].paragraphs[0], + postgraduate_pg_institute, + 12, + ) + + postgraduate_pg_year = input( + "Which year did you complete your post graduation?: " + ) + + change_text( + course_details.columns[2].cells[1].paragraphs[0], + postgraduate_pg_year, + 12, + ) + + postgraduate_pg_percentage = input( + "What was your post graduation percentage obtained?: " + ) + + change_text( + course_details.columns[3].cells[1].paragraphs[0], + postgraduate_pg_percentage, + 12, + ) + + postgraduate_grad_institute = input( + "Which institute did you pursue your graduation in?: " + ) + + change_text( + course_details.columns[1].cells[2].paragraphs[0], + postgraduate_grad_institute, + 12, + ) + + postgraduate_grad_year = input( + "Which year did you complete your graduation?: " + ) + + change_text( + course_details.columns[2].cells[2].paragraphs[0], + postgraduate_grad_year, + 12, + ) + + postgraduate_grad_percentage = input( + "What was your graduation percentage obtained?: " + ) + + change_text( + course_details.columns[3].cells[2].paragraphs[0], + postgraduate_grad_percentage, + 12, + ) + + postgraduate_12th_institute = input( + "Which institute did you pursue your 12th grade in?: " + ) + + change_text( + course_details.columns[1].cells[3].paragraphs[0], + postgraduate_12th_institute, + 12, + ) + + postgraduate_12th_year = input( + "Which year did you complete your 12th grade?: " + ) + + change_text( + course_details.columns[2].cells[3].paragraphs[0], + postgraduate_12th_year, + 12, + ) + + postgraduate_12th_percentage = input( + "What was your 12th grade percentage obtained?: " + ) + + change_text( + course_details.columns[3].cells[3].paragraphs[0], + postgraduate_12th_percentage, + 12, + ) + + postgraduate_10th_institute = input( + "Which institute did you pursue your 10th grade in?: " + ) + + change_text( + course_details.columns[1].cells[4].paragraphs[0], + postgraduate_10th_institute, + 12, + ) + + postgraduate_10th_year = input( + "Which year did you complete your 10th grade?: " + ) + + change_text( + course_details.columns[2].cells[4].paragraphs[0], + postgraduate_10th_year, + 12, + ) + + postgraduate_10th_percentage = input( + "What was your 10th grade percentage obtained?: " + ) + + change_text( + course_details.columns[3].cells[4].paragraphs[0], + postgraduate_10th_percentage, + 12, + ) + + # Asking for ug, 12th and 10th details if user is an graduate. + elif highest_qualification == "graduation": + change_text(course_details.columns[1].cells[1].paragraphs[0], "NA", 12) + change_text(course_details.columns[2].cells[1].paragraphs[0], "NA", 12) + change_text(course_details.columns[3].cells[1].paragraphs[0], "NA", 12) + + graduate_grad_institute = input( + "Which institute did you pursue your graduation in?: " + ) + + change_text( + course_details.columns[1].cells[2].paragraphs[0], + graduate_grad_institute, + 12, + ) + + graduate_grad_year = input( + "Which year did you complete your graduation?: " + ) + + change_text( + course_details.columns[2].cells[2].paragraphs[0], + graduate_grad_year, + 12, + ) + + graduate_grad_percentage = input( + "What was your graduation percentage obtained?: " + ) + + change_text( + course_details.columns[3].cells[2].paragraphs[0], + graduate_grad_percentage, + 12, + ) + + graduate_12th_institute = input( + "Which institute did you pursue your 12th grade in?: " + ) + + change_text( + course_details.columns[1].cells[3].paragraphs[0], + graduate_12th_institute, + 12, + ) + + graduate_12th_year = input( + "Which year did you complete your 12th grade?: " + ) + + change_text( + course_details.columns[2].cells[3].paragraphs[0], + graduate_12th_year, + 12, + ) + + graduate_12th_percentage = input( + "What was your 12th grade percentage obtained?: " + ) + + change_text( + course_details.columns[3].cells[3].paragraphs[0], + graduate_12th_percentage, + 12, + ) + + graduate_10th_institute = input( + "Which institute did you pursue your 10th grade in?: " + ) + + change_text( + course_details.columns[1].cells[4].paragraphs[0], + graduate_10th_institute, + 12, + ) + + graduate_10th_year = input( + "Which year did you complete your 10th grade?: " + ) + + change_text( + course_details.columns[2].cells[4].paragraphs[0], + graduate_10th_year, + 12, + ) + + graduate_10th_percentage = input( + "What was your 10th grade percentage obtained?: " + ) + + change_text( + course_details.columns[3].cells[4].paragraphs[0], + graduate_10th_percentage, + 12, + ) + + # Asking for 12th and 10th details if user is a 12th grader. + elif highest_qualification == "class 12": + change_text(course_details.columns[1].cells[1].paragraphs[0], "NA", 12) + change_text(course_details.columns[2].cells[1].paragraphs[0], "NA", 12) + change_text(course_details.columns[3].cells[1].paragraphs[0], "NA", 12) + + change_text(course_details.columns[1].cells[2].paragraphs[0], "NA", 12) + change_text(course_details.columns[2].cells[2].paragraphs[0], "NA", 12) + change_text(course_details.columns[3].cells[2].paragraphs[0], "NA", 12) + + class12_12th_institute = input( + "Which institute did you pursue your 12th grade in?: " + ) + + change_text( + course_details.columns[1].cells[3].paragraphs[0], + class12_12th_institute, + 12, + ) + + class12_12th_year = input( + "Which year did you complete your 12th grade?: " + ) + + change_text( + course_details.columns[2].cells[3].paragraphs[0], + class12_12th_year, + 12, + ) + + class12_12th_percentage = input( + "What was your 12th grade percentage obtained?: " + ) + change_text( + course_details.columns[3].cells[3].paragraphs[0], + class12_12th_percentage, + 12, + ) + + class12_10th_institute = input( + "Which institute did you pursue your 10th grade in?: " + ) + + change_text( + course_details.columns[1].cells[4].paragraphs[0], + class12_10th_institute, + 12, + ) + + class12_10th_year = input( + "Which year did you complete your 10th grade?: " + ) + + change_text( + course_details.columns[2].cells[4].paragraphs[0], + class12_10th_year, + 12, + ) + + class12_10th_percentage = input( + "What was your 10th grade percentage obtained?: " + ) + + change_text( + course_details.columns[3].cells[4].paragraphs[0], + class12_10th_percentage, + 12, + ) + # Asking for 10th details if user is a 10th grader. + elif highest_qualification == "class 10": + change_text(course_details.columns[1].cells[1].paragraphs[0], "NA", 12) + change_text(course_details.columns[2].cells[1].paragraphs[0], "NA", 12) + change_text(course_details.columns[3].cells[1].paragraphs[0], "NA", 12) + + change_text(course_details.columns[1].cells[2].paragraphs[0], "NA", 12) + change_text(course_details.columns[2].cells[2].paragraphs[0], "NA", 12) + change_text(course_details.columns[3].cells[2].paragraphs[0], "NA", 12) + + change_text(course_details.columns[1].cells[3].paragraphs[0], "NA", 12) + change_text(course_details.columns[2].cells[3].paragraphs[0], "NA", 12) + change_text(course_details.columns[3].cells[3].paragraphs[0], "NA", 12) + + class10_10th_institute = input( + "Which institute did you pursue your 10th grade in?: " + ) + + change_text( + course_details.columns[1].cells[4].paragraphs[0], + class10_10th_institute, + 12, + ) + + class10_10th_year = input( + "Which year did you complete your 10th grade?: " + ) + + change_text( + course_details.columns[2].cells[4].paragraphs[0], + class10_10th_year, + 12, + ) + + class10_10th_percentage = input( + "What was your 10th grade percentage obtained?: " + ) + + change_text( + course_details.columns[3].cells[4].paragraphs[0], + class10_10th_percentage, + 12, + ) + else: + pass + + # Asking the user whether he/she has previous work experience + has_work_experience = input( + "Do you have any previous work experience? [Yes/No]: " + ).lower() + + # Checking if he/she has work experience or not + if has_work_experience == "yes": + # Asking for the number of work experiences. + number_of_work_experiences = input( + "How many companies have you worked for?: " + ) + + # Checking if the user has provided a valid number. + if number_of_work_experiences.isnumeric(): + number_of_work_experiences = int(number_of_work_experiences) + else: + print( + "You haven't entered a valid number. Check if the number you have entered doesn't contain negative values or decimals and try again!" + ) + exit() + + # Getting the first paragraph using an helper tool. + work_experience_previous_paragraph = find_paragraph(document, "WORK EXPERIENCE") + + # Adding the paragraphs after one another containing the work experience information. + for _ in range(0, number_of_work_experiences): + work_experience = input( + "Mention a suitable description for your previous work experience: " + ) + + work_experience_inserted_paragraph = insert_paragraph_after( + document, + work_experience_previous_paragraph, + 12, + work_experience, + ) + work_experience_previous_paragraph = work_experience_inserted_paragraph + + # Passing if the user doesn't have any work experience + elif has_work_experience == "no": + insert_paragraph_after( + document, + find_paragraph(document, "WORK EXPERIENCE"), + 12, + "NA" + ) + else: + print("You haven't mentioned if you have previous work experience or not!") + exit() + + # Asking the user whether he/she has previous internship experience. + has_internship_experience = input( + "Do you have any previous Internship experience? [Yes/No]: " + ).lower() + + # Checking if he/she has previous internship experience or not. + if has_internship_experience == "yes": + # Asking for the number of internship experience(s). + number_of_internship_experiences = input( + "How many internships have you attended?: " + ) + + # Checking if the user has provided a valid number. + if number_of_internship_experiences.isnumeric(): + number_of_internship_experiences = int( + number_of_internship_experiences + ) + else: + print( + "You haven't entered a valid number. Check if the number you have entered doesn't contain negative values or decimals and try again!" + ) + exit() + + # Getting the first paragraph using an helper tool. + internship_experience_previous_paragraph = find_paragraph( + document, "INTERNSHIP EXPERIENCE(S) (IF ANY)" + ) + + # Adding the paragraphs after one another containing the internship experience information. + for _ in range(0, number_of_internship_experiences): + internship_experience = input( + "Mention a description for your previous work experience: " + ) + + internship_experience_inserted_paragraph = insert_paragraph_after( + document, + internship_experience_previous_paragraph, + 12, + internship_experience, + ) + internship_experience_previous_paragraph = ( + internship_experience_inserted_paragraph + ) + + # Passing if the user doesn't have any previous internship experience + elif has_internship_experience == "no": + insert_paragraph_after( + document, + find_paragraph( + document, "INTERNSHIP EXPERIENCE(S) (IF ANY)" + ), + 12, + "NA" + ) + else: + print("You haven't mentioned if you have an internship experience or not!") + exit() + + # Asking the user whether he/she has certificates/courses. + has_certificates_courses = input( + "Do you have any previous Certificates/Courses to your name? [Yes/No]: " + ).lower() + + # Checking if he/she has any certificates/courses or not. + if has_certificates_courses == "yes": + # Splitting the certificates and courses with a "," + certificates_courses = input( + "Mention all the certificates/courses' name seperated by commas (,). Make sure to not include a space after each comma: " + ).split(",") + + # Getting the first paragraph using a helper tool. + certificates_courses_previous_paragraph = find_paragraph( + document, "CERTIFICATIONS/COURSES COMPLETED (IF ANY)" + ) + + # Adding the paragraphs after one another containing the certificate/course information. + for certificate_course in certificates_courses: + certificates_courses_inserted_paragraph = insert_paragraph_after( + document=document, + paragraph=certificates_courses_previous_paragraph, + font_size=12, + description=certificate_course, + ) + + certificates_courses_previous_paragraph = ( + certificates_courses_inserted_paragraph + ) + + # Passing if the user doesn't have any certificate/course + elif has_certificates_courses == "no": + insert_paragraph_after( + document, + find_paragraph( + document, "CERTIFICATIONS/COURSES COMPLETED (IF ANY)" + ), + 12, + "NA" + ) + else: + print("You haven't mentioned if you have a certificate/course or not!") + exit() + + # Asking the user whether he/she has any hobby. + has_skillsets = input("Do you have any skillsets? [Yes/No]: ").lower() + + # Checking if he/she has any skillsets or not. + if has_skillsets == "yes": + # Asking for the skillsets and seperating it by a "," + skillsets = input( + "Mention all the skillsets' name seperated by commas (,). Make sure to not include a space after each comma: " + ).split(",") + + # Getting the first paragraph. + skillsets_previous_paragraph = find_paragraph(document, "SKILL SETS") + + # Adding the paragraphs after one another containing the skillset information. + for skillset in skillsets: + skillsets_inserted_paragraph = insert_paragraph_after( + document=document, + paragraph=skillsets_previous_paragraph, + font_size=12, + description=skillset, + ) + + skillsets_previous_paragraph = skillsets_inserted_paragraph + + # Passing if the user doesn't have any skillset + elif has_skillsets == "no": + insert_paragraph_after( + document, + find_paragraph(document, "SKILL SETS"), + 12, + "NA" + ) + else: + print("You haven't mentioned if you have a skillset or not!") + exit() + + # Asking the user whether he/she has any hobbies. + has_hobbies = input("Do you have any hobbies? [Yes/No]: ").lower() + + # Checking if he/she has any hobby or not. + if has_hobbies == "yes": + # Asking for the hobbies + hobbies = input( + "Mention all the hobbies' name seperated by commas (,). Make sure to not include a space after each comma: " + ).split(",") + + # Getting the first paragraph. + hobbies_previous_paragraph = find_paragraph(document, "HOBBIES AND INTERESTS") + + # Adding the paragraphs after one another containing the hobbies information. + for hobby in hobbies: + hobbies_inserted_paragraph = insert_paragraph_after( + document=document, + paragraph=hobbies_previous_paragraph, + font_size=12, + description=hobby, + ) + + hobbies_previous_paragraph = hobbies_inserted_paragraph + + # Passing if the user doesn't have any hobby + elif has_hobbies == "no": + insert_paragraph_after( + document, + find_paragraph(document, "HOBBIES AND INTERESTS"), + 12, + "NA" + ) + else: + print("You haven't mentioned if you have a hobby or not!") + exit() + + # Asking for the path to save the end document. + path_to_save = input( + "Where do you want to save the file? (Eg: C:/path/to/save/filename.docx) [Note: Relative paths are also allowed]: " + ) + try: + document.save(path_to_save) + except: + print("You have entered an incorrect path. Try again") + exit() + +# Running the script with the __name__ == "__main__" check. +if __name__ == "__main__": + main() diff --git a/src/businesstemplates/templates/Business Card Template.jpg b/src/businesstemplates/templates/Business Card Template.jpg new file mode 100644 index 0000000..bf3bb2e Binary files /dev/null and b/src/businesstemplates/templates/Business Card Template.jpg differ diff --git a/src/businesstemplates/templates/Email Icon Template.png b/src/businesstemplates/templates/Email Icon Template.png new file mode 100644 index 0000000..1419ce1 Binary files /dev/null and b/src/businesstemplates/templates/Email Icon Template.png differ diff --git a/src/businesstemplates/templates/Phone Icon Template.png b/src/businesstemplates/templates/Phone Icon Template.png new file mode 100644 index 0000000..5147ddd Binary files /dev/null and b/src/businesstemplates/templates/Phone Icon Template.png differ diff --git a/src/businesstemplates/templates/Resume Template.docx b/src/businesstemplates/templates/Resume Template.docx new file mode 100644 index 0000000..18928e8 Binary files /dev/null and b/src/businesstemplates/templates/Resume Template.docx differ diff --git a/src/businesstemplates/utils.py b/src/businesstemplates/utils.py new file mode 100644 index 0000000..cef3311 --- /dev/null +++ b/src/businesstemplates/utils.py @@ -0,0 +1,76 @@ +""" +Copyright (c) 2022 That GenZ Gamer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the “Software”), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +""" + +from docx import Document +from docx.text.paragraph import Paragraph +from docx.shared import Pt +from docx.oxml.xmlchemy import OxmlElement +from docx.enum.text import WD_ALIGN_PARAGRAPH + +def change_text( + paragraph: Paragraph, text_to_change: str, font_size: int, is_bold: bool = False +) -> None: + ''' Helper function to change text and font size of a paragraph ''' + + # Changing the text + paragraph.text = text_to_change + + # Changing the font size of each of the runs in the paragraph. + for run in paragraph.runs: + run.font.size = Pt(font_size) + run.font.name = "Times New Roman" + run.bold = is_bold + +def find_paragraph(document: Document, text: str) -> Paragraph: + ''' Helper function to find paragraph with text ''' + + for para in document.paragraphs: + if text in para.text: + return para + +def insert_paragraph_after( + document: Document, + paragraph: Paragraph, + font_size: int, + description: str = None, +) -> Paragraph: + ''' Helper function to insert a paragraph after another paragrapoh ''' + + # Adding a new XML paragraph element. + new_paragraph_element = OxmlElement("w:p") + + # Adding the XML paragraph element after the previous paragraph. + paragraph._p.addnext(new_paragraph_element) + + # Create a Paragraph instance using the created XML paragraph element and + # appending it to the parent of the previous paragraph. + new_paragraph = Paragraph(new_paragraph_element, paragraph._parent) + + # Adding text to the paragraph. + new_paragraph.add_run(f"• {description} ") + + # Changing the font size of the paragraph text. + new_paragraph.style.font.size = Pt(font_size) + new_paragraph.style.font.name = "Times New Roman" + + # Returning the created paragraph + return new_paragraph diff --git a/src/requirements.txt b/src/requirements.txt new file mode 100644 index 0000000..65de0b7 --- /dev/null +++ b/src/requirements.txt @@ -0,0 +1,17 @@ +aiohttp==3.8.1 +aiosignal==1.2.0 +async-timeout==4.0.2 +attrs==21.4.0 +certifi==2021.10.8 +charset-normalizer==2.0.10 +easy-pil==0.1.4 +frozenlist==1.2.0 +idna==3.3 +lxml==4.7.1 +multidict==5.2.0 +Pillow==8.4.0 +python-docx==0.8.11 +requests==2.27.1 +typing_extensions==4.0.1 +urllib3==1.26.8 +yarl==1.7.2 diff --git a/src/setup.cfg b/src/setup.cfg new file mode 100644 index 0000000..ecface3 --- /dev/null +++ b/src/setup.cfg @@ -0,0 +1,49 @@ +[metadata] +name = businesstemplates +author = That GenZ Gamer +author_email = thatgenzgamer@gmail.com +description = An efficient command line tool to create resumes and business cards on the go! +long_description = file: README.md +long_description_content_type = text/markdown +url = https://github.com/ThatGenZGamer48/Hackathon +project_urls = + Bug Tracker = https://github.com/ThatGenZGamer48/Hackathon/issues + Source Code = https://github.com/ThatGenZGamer48/Hackathon +license = MIT +keywords = Resume, Resume Generator, Business Card, Business Template, template, card +classifiers = + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + License :: OSI Approved :: MIT License + Operating System :: OS Independent + +[options] +packages = find: +python_requires = >=3.7 +include_package_data = true +install_requires = + aiohttp==3.8.1 + aiosignal==1.2.0 + async-timeout==4.0.2 + attrs==21.4.0 + certifi==2021.10.8 + charset-normalizer==2.0.10 + easy-pil==0.1.4 + frozenlist==1.2.0 + idna==3.3 + lxml==4.7.1 + multidict==5.2.0 + Pillow==8.4.0 + python-docx==0.8.11 + requests==2.27.1 + typing_extensions==4.0.1 + urllib3==1.26.8 + yarl==1.7.2 + +[options.entry_points] +console_scripts = + resume_generator = businesstemplates.resume_generator:main + business_card_generator = businesstemplates.business_card_generator:main \ No newline at end of file diff --git a/src/setup.py b/src/setup.py new file mode 100644 index 0000000..5fdb912 --- /dev/null +++ b/src/setup.py @@ -0,0 +1,52 @@ +from setuptools import setup, find_packages + +version = "" +with open("VERSION.txt", "r") as version_file: + version = version_file.read() + +long_description = '' +with open("README.rst", "r") as fh: + long_description = fh.read() + +with open("requirements.txt", "r") as requirements_file: + requirements = requirements_file.read().splitlines() + +setup( + name="businesstemplates", + version=version, + author="That GenZ Gamer", + author_email="thatgenzgamer@gmail.com", + license="MIT", + description="An efficient command line tool to create resumes and business cards on the go!", + long_description=long_description, + long_description_content_type="text/x-rst", + url="https://github.com/ThatGenZGamer48/Hackathon", + project_urls={ + "Bug Tracker": "https://github.com/ThatGenZGamer48/Hackathon/issues", + "Source Code": "https://github.com/ThatGenZGamer48/Hackathon", + }, + packages=find_packages(), + classifiers=[ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Topic :: Internet", + "Topic :: Utilities", + "Typing :: Typed", + "Operating System :: OS Independent", + ], + entry_points={ + "console_scripts": [ + "resume_generator=businesstemplates.resume_generator:main", + "business_card_generator=businesstemplates.business_card_generator:main", + ], + }, + install_requires=requirements, + keywords="Resume, Resume Generator, Business Card, Business Template, template, card", + python_requires=">=3.7", + include_package_data=True +) diff --git a/technical_doc.md b/technical_doc.md new file mode 100644 index 0000000..c210700 --- /dev/null +++ b/technical_doc.md @@ -0,0 +1,162 @@ +# businesstemplates Technical Documentation + +**Last updated:** 2022-01-19\ +_Document generation aided by **Documatic**_ + +An efficient command line tool to create resumes and business cards on the go! + +* [Introduction](#introduction) +* [Code Overview](#code-overview) + +## Introduction + +This is a technical document detailing + at a high-level + what businesstemplates does, how it operates, + and how it is built. + +The outline of this document was generated + by **Documatic**. + + + +## Project Architecture + + + + + + + +## Code Overview + +The codebase has a flat structure, with 4 code files. + +The codebase is compatible with Python 3.6 and above, because of f-string 3.6 in /home/tom/Documents/documatic/test_projects/Hackathon/src/businesstemplates/resume_generator.py. + + + + + +`businesstemplates.resume_generator` has a `__main__` entrypoint, which calls: + +* `businesstemplates.resume_generator.main` + +`businesstemplates.business_card_generator` has a `__main__` entrypoint, which calls: + +* `businesstemplates.business_card_generator.main` + + + + + +## Entrypoints + +There are 0 source code entrypoints in top-level `__main__`/`__init__` files. + + + + + +## Concepts + + + + + + + +## Developers + + + + + + + + + +No CI/CD config files were detected. + + + + + + +### **Hackathon/** + + + +#### resume_generator.py + + +File has 871 lines added and 127 lines removed + in the past 4 weeks. ThatGenZGamer48 is the inferred code owner. + + +resume_generator.py has 1 functions. + +```python +main() + +Prepare a nice (custom) ASCII art to show before the start of the inputs. +Does not raise. +The function is complex so cannot be summarised easily. +``` + + + +#### utils.py + + +File has 76 lines added and 0 lines removed + in the past 4 weeks. ThatGenZGamer48 is the inferred code owner. + + +utils.py has 3 functions. + +```python +change_text(paragraph: Paragraph, text_to_change: str, font_size: int, is_bold: bool = False) -> None + +This function takes a paragraph and a string of text to change. It then changes the text in the paragraph to the new text. It then loops through each run in the paragraph and sets the font size and font name to the new values. It then sets the bold property to the new value. + +Helper function to change text and font size of a paragraph. +Does not raise. +``` + +```python +find_paragraph(document: Document, text: str) -> Paragraph + +Helper function to find paragraph with text. +Does not raise. +``` + +```python +insert_paragraph_after(document: Document, paragraph: Paragraph, font_size: int, description: str = None,) -> Paragraph + +This function inserts a paragraph after the paragraph passed as the first argument. +The font size of the inserted paragraph is the font size of the paragraph passed as the first argument. +The inserted paragraph is a copy of the paragraph passed as the first argument. +The inserted paragraph has a line that + +Helper function to insert a paragraph after another paragrapoh. +Does not raise. +``` + + + +#### business_card_generator.py + + +File has 148 lines added and 10 lines removed + in the past 4 weeks. ThatGenZGamer48 is the inferred code owner. + + +business_card_generator.py has 1 functions. + +```python +main() + +Does not raise. +The function is complex so cannot be summarised easily. +``` \ No newline at end of file