Skip to content

Christopher-C-Robinson/Timesheet_Helper

Repository files navigation

Timesheet Helper

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.

Table of Contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Ensure you have Python installed on your machine. The scripts are written in Python 3.

# Check Python version
python --version

Installation

Clone the repository to your local machine.

# Clone the repository
git clone https://github.com/Christopher-C-Robinson/Timesheet_Helper.git

Optional 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

Usage

Web Interface (Recommended)

  1. Install the required dependencies:
pip install -r requirements.txt
  1. (Optional) Configure FLASK_DEBUG, FLASK_HOST, and FLASK_PORT.
  2. Run the web application:
python app.py
  1. Open your browser and go to http://localhost:5000
  2. Paste your bulleted timesheet from Microsoft Word into the text area
  3. Click "Process Timesheet" to get both email format and duration format outputs

Command Line Interface

  1. Copy your bulleted timesheet from Microsoft Word.
  2. Paste it within the timesheet.py script.
  3. Run the timesheet.py script.
# Run the script
python timesheet.py

Scripts

app.py

This 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.

remove_times.py

This script defines a function remove_timespans that removes time spans from the text.

timesheet_helper.py

This script defines a function replace_with_duration that replaces time spans in the text with their corresponding durations.

timesheet.py

This script imports functions from the other two scripts and processes a text-based timesheet.

task_duration.py

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.

Usage

  1. Update ROOT_DIR and WORK_ITEM in the script.
  2. Run the script:
python task_duration.py

azureDevopsAPI.py

This script fetches information about a specific test case from Azure DevOps using the Azure DevOps API.

Usage

  1. Ensure you have the required environment variables set in a .env file:

    • API_VERSION
    • ORGANIZATION
    • PERSONAL_ACCESS_TOKEN
  2. Install dependencies:

python -m pip install requests python-dotenv
  1. Run the script:
python azureDevopsAPI.py

extract_failed_tests_from_xml.py

This script extracts the names of all failed test cases from multiple XML files and copies the formatted list to the clipboard.

Usage

  1. Ensure you have the required directories and file paths set in the script.
  2. Install dependencies:
python -m pip install pyperclip
  1. Run the script:
python extract_failed_tests_from_xml.py

Contributing

If 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •