Timesheet Helper is a collection of Python scripts designed to process text-based timesheets copied from Microsoft Word, plus a few Azure DevOps/test-report helpers.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Ensure you have Python installed on your machine. The scripts are written in Python 3.
# Check Python version
python --versionClone the repository to your local machine.
# Clone the repository
git clone https://github.com/Christopher-C-Robinson/Timesheet_Helper.gitOptional dependencies for helper scripts:
# Web app dependency
python -m pip install -r requirements.txt
# Optional utilities
python -m pip install requests python-dotenv pyperclip python-docx- Install the required dependencies:
pip install -r requirements.txt- (Optional) Configure
FLASK_DEBUG,FLASK_HOST, andFLASK_PORT. - Run the web application:
python app.py- Open your browser and go to
http://localhost:5000 - Paste your bulleted timesheet from Microsoft Word into the text area
- Click "Process Timesheet" to get both email format and duration format outputs
- Copy your bulleted timesheet from Microsoft Word.
- Paste it within the
timesheet.pyscript. - Run the
timesheet.pyscript.
# Run the script
python timesheet.pyThis script provides a web interface for the Timesheet Helper. It uses Flask to create a simple web application where users can paste their timesheet data and get both email and duration formats as output.
This script defines a function remove_timespans that removes time spans from the text.
This script defines a function replace_with_duration that replaces time spans in the text with their corresponding durations.
This script imports functions from the other two scripts and processes a text-based timesheet.
This script scans a root directory for .docx/.txt files and totals time spans from lines that match a work item identifier. Configure ROOT_DIR, WORK_ITEM, EXTENSIONS, and VERBOSE. Install python-docx if you use .docx files.
- Update
ROOT_DIRandWORK_ITEMin the script. - Run the script:
python task_duration.pyThis script fetches information about a specific test case from Azure DevOps using the Azure DevOps API.
-
Ensure you have the required environment variables set in a
.envfile:API_VERSIONORGANIZATIONPERSONAL_ACCESS_TOKEN
-
Install dependencies:
python -m pip install requests python-dotenv- Run the script:
python azureDevopsAPI.pyThis script extracts the names of all failed test cases from multiple XML files and copies the formatted list to the clipboard.
- Ensure you have the required directories and file paths set in the script.
- Install dependencies:
python -m pip install pyperclip- Run the script:
python extract_failed_tests_from_xml.pyIf you would like to contribute to the Timesheet Helper project, please feel free to fork the repository, create a feature branch, and submit a pull request.