This is my solution to the Back-End coding challenge as part of SPAN's interview process
- Table of Contents
- Project Structure
- How To Run The CLI
- Technologies Used
- Future Expansions
- Installation Instructions
- Problem Statement
- Miscellaneous
.
├── Makefile
├── README.md
├── application
│ └── ranking_calculator.py
├── assets
│ ├── problem_statement_1.png
│ └── problem_statement_2.png
├── cli.py
├── dev-requirements.in
├── dev-requirements.txt
├── lib
│ └── constants.py
├── pyproject.toml
├── requirements.in
├── requirements.txt
├── results
├── scripts
│ └── test.sh
├── setup.py
├── test_input
│ └── example_input.txt
├── tests
│ ├── test_cli.py
│ └── test_ranking_calculator.py
└── version
The CLI has 2 flags to specify input. -i, --input
indicates manual input and -p path, --path path
provides the path to the file to be used as input.
The CLI also has 2 suppourting flags. -h, --help
for help and -v, --version
for the CLI's version.
There are 2 ways one can run this project
Note: Since this project should run on OSX, I will have included a OSX compatible executable file in the root folder already.
- Clone the repo
- Create a virtual environment
- Run
make deps
- Run
make compile
- In the root folder a new exe file should appear
- From the root folder the CLI can be started using the executale. PS. try
ranking_calculator -h
- Clone the repo
- Create a virtual environment
- Run
make deps
- From the root folder the CLI can be started using python. PS. try
python cli.py -h
- For the creation of the CLI, the
argparse
library was used. - For compiling the application into an executable file the
pyinstaller
library was used. The executale has to be regenerated on different operating systems, as it generates and executable file for that type of operating system. - For testing the
pytest
,coverage
,mockito
¶meterized
libraries were used. - For code quality the
pre-commit
,black
,flake8
,isort
, &pylint
libraries were used. - For dependency management the
pip-tools
library was used. - Github actions were used to automate testing & linting
Using the Github actions, it would've been useful to automate the compilation to an executable file as well, but since pyinstaller
compiles the exectable to be compatible with the OS the user is using, the compiled executable file would only work on the OS of whatever Github runs their actions on (some light-weight Linux probably). Thus in future it would be great to find a library that can compile it into three executable files, one for the 3 most popular OS's, and have it auto compile as part of Github actions.
Before running the following commands, please ensure you have started a python 3.10 virtual environment.
make update
make deps
Before running the following commands, please ensure you have started a python 3.10 virtual environment and run the make deps
command.
make compile
make test
make lint