https://github.com/orestes7054/acme
App to calculate salary of Acme's Employees
https://github.com/orestes7054/acme
pip python python3
Last synced: about 2 months ago
JSON representation
App to calculate salary of Acme's Employees
- Host: GitHub
- URL: https://github.com/orestes7054/acme
- Owner: orestes7054
- License: mit
- Created: 2022-05-16T15:16:58.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-08T16:17:34.000Z (about 3 years ago)
- Last Synced: 2025-01-30T22:51:44.759Z (over 1 year ago)
- Topics: pip, python, python3
- Language: Jupyter Notebook
- Homepage:
- Size: 108 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Architecture
The main function of the program is to compute the total payment amount for the employees of the ACME Company. The input is a .txt file with this format:
RENE=MO10:00-12:00,TU10:00-12:00,TH01:00-03:00,SA14:00-18:00,SU20:00-21:00
**The output:**
The amount to pay RENE is: 215 USD
Directory Tree
./
├── ACME
│ ├── acme.txt
│ ├── errors.py
│ ├── __init__.py
│ ├── __main__.py
│ ├── payment_class.py
│ ├── payment.json
│ └── utils.py
├── acme_employee_payment_roll.txt
├── LICENSE
├── README.md
├── result.html
├── setup.py
└── test
├── data
│ ├── empty_file.txt
│ ├── test_acme_five_employees.txt
│ ├── test_acme.txt
│ └── wrong_format.jpg
├── __init__.py
└── test_acme.py
5 directories, 25 files
Sorted by hierarchy the ACME file contains the core operations. In **payment_class.py** is the main class that make the computation. In **utils.py** are the function to check the user's input, clear the data and transform text to datetime objects. In **errors.py** are the classes for erorrs. *I tried to keep the project as simple as posible and don't abuse the Classes' use; avoiding the re-calling of simple functions*. The **test** folder includes all the neccesary elements to test the code. The **setup.py** is use to create all the neccesaries elements to make a module of every folder with no problems. [Related to setup.py](https://xkcd.com/353/)
In the utils.py the functions are concatenate, this is a practice I inherit from VBA where you usually call a function from a function and run the program consecutively, this is also use in Google Apps Script. The days and payment information is in the payment.json file; the AcmeEmployee class reads this file and obtain the data.

### Installation via PIP
pip install acme-ioet-orestes
Then use terminal with:
For instructions
ACME -h
To see and example:
ACME -example
To use the program
ACME <path to the .txt file>
If you want to save a copy of the output:
ACME -sc <path to the .txt file>
### Manual Installation
git clone https://github.com/orestes7054/acme.git
cd acme
pip install .
For instructions
python ACME -h
To see and example:
python ACME -example
To use the program
python ACME <path to the .txt file>
If you want to save a copy of the output:
python ACME -sc <path to the .txt file>
### Test
git clone https://github.com/orestes7054/acme.git
cd acme
pip install .
python -m unittest -v
### Assumptions
1. The employees can not make portion of hour, they have to submit a complete hour.
2. An employee can not make just one day of work, the program will not read a line like this: RENE=MO10:00-15:00. If this assumptions is not correct, to change this and read just one day we need to change the **check_line** function regex.
* * *
NOTE: The use of the command is to avoid dependencies problems. For some version of linux (ubuntu 18.04 for example) the use of is not recommended.
For use is recommended the pip via install.