The title says it all! Updated functionality to see, modify, and add teams to the database via scripting and files.
Functions added are shown below, which is the same documentation that I added to the ReadME:
create_team_table
Description
Generates new team entries with unique identifiers based on a specified prefix and saves them to the database and a CSV file. The script takes care of password generation for each team and saves the updated team data back to the specified file. If the CSV file doesn’t exist, it will be created with the appropriate columns.
The script does not update any changes from the file, so anything in the file but not in the database will be reverted similar to the teams_to_csv script.
This command follows these rules:
New teams are created with unique names based on the given prefix and are assigned unique passwords.
Existing teams database are shown in the teams.csv file.
The generated team data is saved back to the specified file, ensuring the CSV reflects the current state of the team table.
Alphabetic prefix for team names. Each new team name will start with this prefix, followed by a unique number.
number_of_teams
Number of new teams to create. This must be an integer.
date
Date for team activities in the format mm/dd/yyyy.
start_time
Start time for team activities in HH:MM format, on the specified date.
end_time
End time for team activities in HH:MM format, on the specified date.
file_path
Path to the CSV file where the updated team information will be saved. If the file does not exist, it will be created with default columns. Must have a .csv extension. DEFAULT: es_files/teams.csv
load_teams
Description
Loads a local teams.csv table into the database. This command will take care of password generation for teams as they are initialized and add them to the csv file. No password overwriting occurs in this script.
This command is safe... meaning it follows these rules:
Where a team is identified by it's team number...
Any team in the database but NOT in the file will be added to the file
Any team in the file but NOT in the database will be added to the database
Any team in both the file and database will update the database to the file's fields (if there are changes)
Command
python3 -m backend.script.load_teams <file_path>
Arguments
Argument
Description
file_path
File containing updated team information. Upon completing, this file is altered to show the current state of the team table in the database
teams_to_csv
Description
Updates or generates a teams.csv file containing the current state of the database.
This command is NOT safe... meaning any changes in the teams.csv file will be deleted!
OPTIONAL. File to be filled with team table information. Upon completing, this file is altered or generated to show the current state of the team table in the database. Default: es_files/teams.csv
teams_to_database
Description
Updates the teams table in the database to match the teams.csv file provided.
This command is NOT safe... meaning any changes and deletions in the teams.csv will be perminant!
This command is safe... meaning it follows these rules:
Where a team is identified by it's team number...
Any team in the database but NOT in the file will be DELETED from the database
Any team in the file but NOT in the database will be ADDED to the database
Any team present in both will be UPDATED according the file's specifications
File containing updated team information. Upon successful completion, the database will be updated to the file's specifications.
reset_unique_words
Description
The unique_word_list is our current tool for password generation. As more teams are made and more passwords are generated, the word list depletes. This function resets only the word list so that new passwords can be generated.
Command
python3 -m backend.script.reset_unique_words
Arguments
NA
reset_teams
Description
Will permenantly delete ALL DATA in the team table of the database.
The title says it all! Updated functionality to see, modify, and add teams to the database via scripting and files.
Functions added are shown below, which is the same documentation that I added to the ReadME:
create_team_table
Description
Generates new team entries with unique identifiers based on a specified prefix and saves them to the database and a CSV file. The script takes care of password generation for each team and saves the updated team data back to the specified file. If the CSV file doesn’t exist, it will be created with the appropriate columns.
The script does not update any changes from the file, so anything in the file but not in the database will be reverted similar to the
teams_to_csv
script.This command follows these rules:
New teams are created with unique names based on the given prefix and are assigned unique passwords.
Existing teams database are shown in the
teams.csv
file.The generated team data is saved back to the specified file, ensuring the CSV reflects the current state of the
team
table.Command
Arguments
prefix
number_of_teams
date
mm/dd/yyyy
.start_time
HH:MM
format, on the specified date.end_time
HH:MM
format, on the specified date.file_path
.csv
extension. DEFAULT:es_files/teams.csv
load_teams
Description
Loads a local
teams.csv
table into the database. This command will take care of password generation for teams as they are initialized and add them to the csv file. No password overwriting occurs in this script.This command is safe... meaning it follows these rules: Where a team is identified by it's team number...
Command
python3 -m backend.script.load_teams <file_path>
Arguments
file_path
team
table in the databaseteams_to_csv
Description
Updates or generates a teams.csv file containing the current state of the database.
This command is NOT safe... meaning any changes in the teams.csv file will be deleted!
Command
Arguments
file_path
team
table in the database. Default:es_files/teams.csv
teams_to_database
Description
Updates the teams table in the database to match the teams.csv file provided.
This command is NOT safe... meaning any changes and deletions in the teams.csv will be perminant!
This command is safe... meaning it follows these rules: Where a team is identified by it's team number...
Command
Arguments
file_path
reset_unique_words
Description
The
unique_word_list
is our current tool for password generation. As more teams are made and more passwords are generated, the word list depletes. This function resets only the word list so that new passwords can be generated.Command
Arguments
NA
reset_teams
Description
Will permenantly delete ALL DATA in the team table of the database.
Command
Arguments
NA