Files
pancake-tui/hubstaff-cli/README.md
2025-12-22 15:23:44 -05:00

1.6 KiB

Hubstaff CLI

This project is a command-line interface (CLI) tool for fetching timesheet data from the Hubstaff API. It provides a simple way to interact with the API and retrieve timesheet information formatted according to specified requirements.

Table of Contents

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd hubstaff-cli
    
  2. Install the required dependencies:

    pip install -r requirements.txt
    
  3. Set up your environment variables for the Hubstaff API:

    • Create a .env file in the root directory and add your Hubstaff API key:
      HUBSTAFF_API_KEY=your_api_key_here
      

Usage

To run the timesheet data fetching script, execute the following command:

python src/timesheet.py

This will log in to the Hubstaff API and fetch the timesheet data for the specified user and date range.

Output Format

The output will be displayed in a tabular format with the following columns:

  • Date: The date of the time entry.
  • Started At: The time the entry started.
  • Tracked (minutes): The total minutes tracked for the entry.

Example output:

| Date       | Started At | Tracked (minutes) |
|------------|------------|--------------------|
| 2023-10-01 | 09:00      | 120                |
| 2023-10-01 | 13:00      | 60                 |

Dependencies

  • requests: For making HTTP requests to the Hubstaff API.
  • python-dotenv: For loading environment variables from a .env file.