b021eabdab
Refactored `script.py` by adding detailed docstrings and organizing functions. Created `.idea` configuration files and `gotodashboard.js` for `sisa_crawl` project. Added `readme.md` files with usage instructions and context for multiple scripts, and set up `package.json` for `sisa_crawl` dependencies. |
||
---|---|---|
.. | ||
readme.md | ||
script.py |
Project Name: Examination Data Processing
Overview
This project is designed to process examination data from an Excel file and generate filtered output and communication messages for teaching staff. It's developed using Python and pandas, and it provides functionalities such as filtering records, converting time formats, and generating message columns.
Features
- Read Excel File: Reads examination data from an Excel file into a Pandas DataFrame.
- Filter Data: Filters records based on specific criteria in 'Studiegidsnummer' and 'Opmerkingen' columns.
- Convert Time Format: Converts time columns to 'HH:MM' format.
- Generate Messages: Creates message and subject columns for email communication.
- Save to Excel: Saves the processed data to a new Excel file.
Prerequisites
- Python 3.12.5
- Pandas
- openpyxl
Installation
-
Clone the repository:
git clone https://github.com/username/examination-data-processing.git cd examination-data-processing
-
Install the required Python packages:
pip install -r requirements.txt
Ensure the
requirements.txt
file should contain:pandas openpyxl
Usage
-
Place the input Excel file: Ensure that the Excel file (
examengegevens2425.xlsx
) is placed in the root directory of the project. -
Run the script:
python script.py
-
Output: The filtered and processed data will be saved in an output Excel file (
filtered_examengegevens2425.xlsx
).
Functions
read_excel_file(file_path)
- Parameters:
file_path
(str) - Path to the Excel file. - Returns: DataFrame or None
filter_studiegidsnummer(df)
- Parameters:
df
(DataFrame) - Input DataFrame. - Returns: Filtered DataFrame or empty DataFrame
filter_opmerkingen(df)
- Parameters:
df
(DataFrame) - Input DataFrame. - Returns: Filtered DataFrame or empty DataFrame
create_message_column(df)
- Parameters:
df
(DataFrame) - Input DataFrame. - Returns: DataFrame with 'Message' and 'subject' columns
save_to_excel(df, output_file_path)
- Parameters:
df
(DataFrame) - DataFrame to save.output_file_path
(str) - Path to save the Excel file.
- Returns: None
convert_time_format(time_str)
- Parameters:
time_str
(str) - Time string to convert. - Returns: Formatted time string
apply_time_format_conversion(df, columns)
- Parameters:
df
(DataFrame) - DataFrame with time columns.columns
(list of str) - List of column names to format.
- Returns: DataFrame with formatted time columns
main()
- Main function to execute the entire process: reading the Excel file, filtering data, converting time formats, creating message columns, and saving to Excel.
Example
if __name__ == "__main__":
main()
Contributing
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
. - Make your changes and commit:
git commit -m 'Add new feature'
. - Push to the branch:
git push origin feature-branch
. - Submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for more information.
Acknowledgements
Author
- AI Assistant (Your Name or Contributors)
For additional information or support, please contact
your-email@example.com
.