A Python script that uses Airium to generate HTML code for the Alpha Eta website.
In your Python environment, install Pip.
Then, install Airium by typing into the commandline: pip install airium
-
Edit/update the CSV file that you're trying to generate HTML for (either
active.csv
,conditionals.csv
, orofficers.csv
) -
In the directory with the script and csv file, run the script depending on which you're updating (
python active_brotherscript.py
,python conditional_brotherscript.py
, orpython officer_brotherscript.py
) -
If the CSV files are valid and everything worked correctly, an HTML file is generated under the name of
generated_active.html
,generated_conditional.html
, orgenerated_officers.html
, and then you would copy and paste the contents of that file into the corresponding section in the HTML file of the website.
Name|Pronouns|Initiation Semester|Hometown|Instrument|Majors|Minors (if not applicable, type N/A)
Name|Pronouns|Officer Position|Officer Email|Initiation Semester|Major|Instrument|Quote about brotherhood (if not applicable, type N/A)
Currently, Alpha Eta has 8 Elected Officer positions and 8 Appointed Officer positions, and it is hardcoded to reflect those values through lines 33 and 34:
num_elected = 8
num_appointed = 8
If these numbers change through the creation or removal of officer positions, you can change those variables and it will work as intended. But, officers.csv
must be set-up in the order that you would like for it to appear on the website.
Your machine may have a case-insensitive system, but HTML is a case-sensitive language, so in order for images to be displayed correctly, they must be named with the right casing, as in First_Last.JPG
. The pictures also must be 1000 x 1333 pixels for uniformity and decent image quality.
Keep the CSV files updated every semester! And if you feel like this can be improved in any way, use your best judgment, don't break anything, and as always, test your code before you push it.