Package: pgssret
Compass Group PGSS Payslip RetrieverThis is a Python script that retrieves your pay slips from Compass Group's PGSS
website and sends to your email. I wrote this script so I don't have to log onto
the stupid site every time I want to get my pay slips. What a stupid way to do
things.I could've just filed an OFI to tell them to just email all the pay slips just
like any other normal companies do. Yup, that's gonna work because Compass Group
is more than capable of doing that.Well, sack me then.Usagepython3-mpgssret-f<config>Where<config>is the path to the yaml configuration file. The sample is
located at/docs/configs/sample.yaml.SetupInstallationInstall the module using PIP.pipinstallpgssretConfiguration and Cache SetupThe config format is pretty self-explanatory. I copied and pasted into this doc
below for reference.pgss-ret:auth:username:USERNAMEpassword:PASSWORDdir:cache:cachetmp:tmplimits:eml-size:5242880# 5 MiBnb-attachments:20# Initial start up behaviour#   0: Attach only one latest pay slip only (recommended)#   1: Don't email. Pay slips will be sent on the subsequent launches#   2: Email all the pay slips obtainable. A large quantities of pay slips#      will be sent in multiple mailsinit-mode:0post:subject:Pay Slip from Compass Groupbody:See attached.backend:smtplibparams:proto:smtp# or 'smtps' or 'lmtp'# from: from@example.com# Allow use of unencrypted session. Set to true if using localhost# allow-plaintext: false# host: smtp.example.com# port:# tlscert:# tlskey:# cred: # smtp auth credentials#   username:#   password:recipients:# - person@example.comYou won't have to worry about cache and tmp dirs as long as you set the working
directory of the process correctly. I recommend preparing following paths for
the working directory of the module.Linux~/.cache/pgssretfor tmp and cache~/.config/pgssretfor the configWindows:%appdata%\pgssretfor everythingOr you can use arbitrary directories on your machine and set them using absolute
paths.Copy the sample config to a new location. Rename it topgssret.yamland edit
it. All you will have to change should be the username and password you use to
log onto the website. Then test the config by launching the module.# Linuxcd~/.cache/pgssret
python3-mpgssret-f~/.config/pgssret/pgssret.yaml# Windows (Powershell or cmd)cd%appdata%\pgssretpython3-mpgssret-f%appdata%\pgssret\pgssret.yamlIf you mess up, debug the config and delete the cache file(named as
YOUR_EMPLOYEE_NUMBER.json) before relaunching the module. If you manage to get
the module to send an email successfully and you've confirmed that the email
has reached the inbox, you can move onto setting a scheduled task.Schedule Module LaunchOn Linux, use crond or a Systemd timer to have the module poll your pay slips
periodically.Runcrontab -eto edit the user crontab like so.# To get error reports in the event of failure.
#MAILTO=

# Run pgssret every day at noon. Redirect STDOUT to the null device to get
# reports on errors only.
00 12 *  *  * cd ~/.cache/pgssret && python3 -m pgssret -f ~/.config/pgssret/pgssret.yaml > /dev/nullAnd make sure crond is running and you're good to go! Forget that you did all
this and let your computer get the pay slips for you from now on.Another options is to make the machine run the module every time it boots up by
making a "oneshot" Systemd service or dropping a shell script in rc.d.On Windows, Task Scheduler can do the trick.Gmail ExampleIf you plan to use an external SMTP rather than a local one and set up a mail
filter on your email service[^1], here's the example using Gmail SMTP. You will
need to create anApp
Passwordfor the module.# ...params:proto:smtpsfrom:you@gmail.comhost:smtp.gmail.comcred:username:you@gmail.compassword:THE_APP_PASSWORDrecipients:-you@gmail.com[^1]: which is reasonable considering the fact that SMTP daemon implementations
are quite heavy and it's tedious to set up a mail filter so that the mails
sent from your local machine are not marked as spam