Skip to content

hawkab/work-report-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧾 Work Report Generator

EN | RU

Work Report Generator is a Python tool designed for automatically generating PDF work reports based on activity from GitLab, JIRA, Confluence, and Redmine.

It collects user actions for a specified period, groups them by day, adds additional activities (daily meetings, planning sessions, and retrospectives), visualizes statistics, and creates a PDF report. Optionally, the report can be automatically sent by email or uploaded to FTP.


⚙️ Minimum System Requirements

Component Requirement
Python 3.9 or higher
Dependencies see requirements.txt or pyproject.toml
Font DejaVuSans.ttf file for PDF (optional)

📦 Installation

  1. Clone the repository:

    git clone https://github.com/hawkab/work-report-generator.git
    cd work-report-generator
  2. Install dependencies either via:

    pip install .

    Or:

    pip install -r requirements.txt

🛠 Configuration

  1. Obtain API tokens for all used systems (GitLab, Jira, Confluence, Redmine)

  2. Optional: Obtain SMTP parameters for sending reports via email

  3. Optional: Obtain FTP parameters for uploading reports to an FTP server

  4. Create a .env file in the project root or in your home directory, based on the .env.example template:

    ...
    GITLAB_URL=https://gitlab.example.com
    GITLAB_TOKEN=your_gitlab_token
    GITLAB_USERNAME=username
    ...
  5. Vacation settings 📆 (vacations.json)

If you did not work on certain days (e.g., vacation, sick leave, or day off), you can list these dates in the vacations.json file to:

  • avoid generating static activity for those days;
  • exclude them from the report;
  • accurately reflect absence periods.

📁 Location

The vacations.json file should be located in the project root.

🧾 File Format

The file should be a JSON array of objects with from and to keys in YYYY-MM-DD format.

[
  {
    "from": "2025-02-17",
    "to": "2025-02-21"
  },
  {
    "from": "2025-03-17",
    "to": "2025-03-21"
  }
]

🔄 If from and to are the same, it is considered a single-day absence.


🚀 Usage

Generate a report for a specific period:

work-report --start 01.07.2025 --end 31.07.2025

Generate and send the report via email and upload it to FTP:

work-report --start 01.07.2025 --end 31.07.2025 --email --ftp

📁 Output

  • The PDF file will be saved in the working directory ./report_generator/reports
  • File name format: work_report_YYYY-MM-DD_YYYY-MM-DD.pdf
  • Example report
  • img.png

Additional Notes

  • To view the report archive, you can use Google Drive or your own hosting with a PHP script
  • To upload reports from ftp to Google Drive, you can use rclone:
  1. Install rclone:
curl https://rclone.org/install.sh | sudo bash
  1. Configure Google Drive:
rclone config
  • n (new connection)
  • name, e.g.: gdrive
  • type: Google Drive
  • complete browser authorization.
  1. Copy files from FTP to Google Drive:
rclone copy ftpuser:password@ftp.example.com:/path gdrive:/Backup --progress

🤝 Acknowledgments

Many thanks to the authors of these libraries for their contribution to open source 💚

About

Automatic generation of PDF reports on work done based on activity from GitLab, JIRA, Confluence and Redmine.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors