Skip to content

L0RD-ZER0/greytHR-payslip-downloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payroll Slip Downloader

A Python-based command-line application to download payroll slips (Payslip, CTC, Reimbursement) from greytHR. The application supports multithreaded downloads, retries, and configurable options via a TOML configuration file.

Features

  • Fetches and downloads payroll slips from greytHR.
  • Supports multiple slip types: Payslip, CTC-Payslip, and Reimbursement-Payslip.
  • Multithreaded downloads for faster processing.
  • Configurable retry attempts and delays for failed downloads.
  • Automatic skipping for any payslips which were not issued.
  • Outputs logs with customizable log levels.
  • Supports filtering slips by ID range.
  • Configurable via a simple TOML file.
  • Drop anywhere with Python 3.11+ installed.

Requirements

I don't see a requirements.txt file in the repository. Where is the reqruiements.txt file?

There is none! You do not need to install anything other than the basic Python 3.11 or higher, with standard libraries. This script doesn't make use of any external libraries, and relies solely on Python's brilliant standard library.

Installation

Clone the repository:

# Via Git
git clone 'https://github.com/L0RD-ZER0/greytHR-payslip-downloader.git' 'payroll-slip-downloader'

# or use SSH if you prefer that
# git clone '[email protected]:L0RD-ZER0/greytHR-payslip-downloader.git'

cd payroll-slip-downloader

Or Download the ZIP file from GitHub and extract it.

# Via Wget
wget -O 'payroll-slip-downloader.zip' 'https://github.com/L0RD-ZER0/greytHR-payslip-downloader/archive/refs/heads/main.zip'

# Via cURL
curl -fSsLo 'payroll-slip-downloader.zip' 'https://github.com/L0RD-ZER0/greytHR-payslip-downloader/archive/refs/heads/main.zip'

unzip payroll-slip-downloader.zip

Usage

1. Create a configuration file in TOML format (e.g., config.toml). You can refer to the config.example.toml file in the repository for guidance.

  1. Run the application:

    python main.py --config config.toml
  2. The downloaded slips will be saved in the specified output directory.

Configuration

The application uses a TOML configuration file. Below are the available options:

Configuration Options

The following table lists the configuration options available in the config.toml file:

Configuration Options
Option Description Default Value Required Example
cookie Authentication cookie for API requests. None Yes "_hjSessionUser_734540=eyJ..."
host API host. None Yes "example.greythr.com"
profile_id Profile ID for fetching slips. None Yes 321
payslip_id_start Start range for slip IDs. None No 100
payslip_id_end End range for slip IDs. None No 200
payslip Enable downloading of Payslips. true No true
ctc Enable downloading of CTC slips. true No true
reimbursement Enable downloading of Reimbursement slips. true No false
output_directory Directory to save downloaded slips. ./payslips No "./downloads"
max_concurrent_downloads Maximum concurrent downloads. 5 No 10
retry_attempts Number of retry attempts for failed downloads. 3 No 5
retry_delay_seconds Delay between retries in seconds. 2 No 5
log_level Logging level. Only logs at or above this level will be shown. info No "info"

Logging

Logs are output to the console's standard output stream and include details about the download process. The log level can be configured in the TOML file.

Using it as a Library

You can also use the core functionality of this application as a library in your own Python scripts. Make sure to import the necessary functions and create a config object based on the Config dataclass. Almost all functions can be used independently, except for a very few.

License

This project is licensed under the GNU Affero General Public License v3.0. You can find the full license text in the LICENSE file.

About

Quick and Dirty Payslip Downloader for greytHR so I don't have to

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages