Get student information (rows) from files and convert into html. The program will generate a html file. For staffs at Gettysburg College who work with dotCMS system, we can copy source code from that file and paste it into the dotCMS editing page, especially for editing Dean's Honor List and Dean's Commendation List.
- Data folder:
file_name.csv
orfile_name.xlsx
: the files that need to be convert into html. Data is stored as a table following our format.
- Doc folder:
model.jpg
: the structure of this program as a UML graph.
- Output folder:
output_file.html
: the output file of this program.
- Tool folder:
table.py
:contains object-oriented classTable
. EachTable
object is a class year cohort including:table_id
: each table will have only one unique idtable_name
: name of tablerows
: each row is a student with information stored as Dictionary
reader.py
: contains object-oriented classReader
needed to pass parameter: data file path asstr
. This class reads data from.csv
or.xlsx
file and store data in each class each asrows
inTable
object.page.py
: contains object-oriented classPage
needed to pass parameter: aReader
object. This class contains skeleton structure for HTML file.
main.py
: the main file to run this program.requirements.txt
: contains required libraries and their version. Follow How to run the package section to know how to use this file.
File location:
- All files must be put in
data
folder.
File format:
- Column name (1st row): Last-Name, First-Name, Middle-Name, Exp-Grad.
- Students are listed in order from Seniors, Juniors, Sophomores, and First Years.
- Note: check files
Deans Commendation List.csv
orDeans Commendation List.xlsx
in folderdata
for examples.
Last-Name | First-Name | Middle-Name | Exp-Grad |
---|---|---|---|
Seniors | |||
stud's last | stud's first | stud's middle | Exp Grad yr |
... | ... | ... | ... |
Juniors | |||
stud's last | stud's first | stud's middle | Exp Grad yr |
... | ... | ... | ... |
Sophomores | |||
stud's last | stud's first | stud's middle | Exp Grad yr |
... | ... | ... | ... |
First Years | |||
stud's last | stud's first | stud's middle | Exp Grad yr |
... | ... | ... | ... |
- Requirements:
- Python 3
- Run this in bash:
- Install related python library:
pip3 install -r ./requirements.txt
- Run the main file from the package:
- To get html of Commendation List:
The html file can be found in# python3 main.py <data_file> <output_file> # For example: python3 main.py "Deans Commendation List.csv" "commendation.html"
output
folder.
- Note: You can change
pip3
topip
andpython3
topython
if possible. - Note: command
Deans Commendation List.csv
can be changed based on your file name.