The Clockify Report Generator is a powerful Python-based tool designed to streamline the process of creating weekly accomplishment reports from Clockify time entries. By leveraging the Clockify API, this application fetches time data, processes it, and generates a professional Excel report based on a customizable template.
- 🔗 API Integration: Seamlessly fetches time entries from the Clockify API.
- 📅 Flexible Time Selection: Generate reports for the current or previous week.
- 🔄 Data Transformation: Processes raw time data into a structured format.
- 📊 Excel Report Generation: Creates polished reports using a predefined Excel template.
- 🌐 Timezone Support: Handles time conversions to your local timezone.
- 🖥️ User-Friendly Interface: Includes a Windows batch script for easy execution.
- 🎨 Customizable Output: Generates uniquely named files based on user and date information.
Before you begin, ensure you have the following:
- 🐍 Python 3.7 or higher
- 🔑 A Clockify account with API access
- 📘 Microsoft Excel (for viewing generated reports)
- 🐙 Git (for cloning the repository)
-
Clone the repository:
git clone https://github.com/your-username/clockify-report-generator.git cd clockify-report-generator -
Set up a virtual environment:
python -m venv virtualenv
-
Activate the virtual environment:
- Windows:
.\virtualenv\Scripts\activate
- macOS/Linux:
source virtualenv/bin/activate
- Windows:
-
Install required packages:
pip install -r requirements.txt
- Create a
.envfile in the project root directory. - Add your Clockify configuration:
Replace the values with your actual Clockify details.
WORKSPACE_ID=your_workspace_id USER_ID=your_user_id API_KEY=your_api_key POSITION=your_position BASE_URL=https://api.clockify.me/api/v1 TIMEZONE=Asia/Manila - Leave the
USER_ID&WORKSPACE_IDempty to get your user ID & workspace ID using your API key
Run the script with the following command:
python app.py --week [current|previous]Replace [current|previous] with your desired option.
Or using specified dates with start and end date range
python app.py --start_date 2024-08-12 --end_date 2024-08-16- Double-click the
run.batfile. - Follow the on-screen prompts to select the desired week.
- The script will execute and generate the report automatically.
clockify-report-generator/
│
├── 📜 app.py # Main application script
├── 📜 configuration.py # Configuration loader
├── 📜 api_client.py # Clockify API client
├── 📜 data_processing.py # Data processing functions
├── 📜 run.bat # Windows batch script
├── 📜 requirements.txt # Python dependencies
├── 📊 template.xlsx # Excel report template
│
├── 📁 utils/
│ └── 📜 logger.py # Logging configuration
│
└── 📁 output/ # Generated reports directory
Generated reports are saved in the output/ directory with the following naming convention:
Accomplishment Report [MMYYYY Week#N] - LastName, FirstName, MiddleInitial..xlsx
MMYYYY: Month and yearN: Week number of the monthLastName,FirstName,MiddleInitial: User's name from Clockify
- 📊 Excel Template: Modify
template.xlsxto change the report layout. - 🌐 Timezone: Adjust the
TIMEZONEvariable in the.envfile to match your locale. - 📝 Output Format: Edit the
generate_filename()function inapp.pyto change the output file naming convention.
- 🔌 API Connection Issues: Verify your API key and internet connection.
- 🕰️ Incorrect Time Data: Ensure your Clockify workspace timezone settings are correct.
- 📊 Excel Template Errors: Make sure
template.xlsxis in the project root and follows the expected format.
