Skip to main content

Wmt2Ics

Description

Using Web Schedules (wmtscheduler or wmt) Views: My Schedule as data, highlight and copy the pay period schedule. Once you start the script, enter the pay period number, the module will then automagically paste the copied data (you will not see anything on the terminal window). The information will then be parsed and converted into an Internet Calendar Sharing file (.ics) which can then be imported into Apple iCal, Google Calendar, etc.

Information

Built and tested in Python 3.8

This module takes advantage of python library icalendar which is a RFC5545 parser/generator for iCalendar files. It also uses pyperclip to paste the copied data.

Use Case 1

  1. Create a python file:
#!/usr/bin/env python3
from wmt2ics import Wmt2Ics as wmt

wmt() # Default run_method='desktop'
  1. Save the file and make it executable.
  2. Navigate to Web Scheduler, once logged in, select Views, then My Schedule.
  3. Copy the the pay period by highlighting and Ctrl+c to copy.
  4. Go to Terminal and run python3 yourfile.py
    • Enter the pay period number - This will be part of your saved .ics filename
  5. Once completed you should find "Pay_Period_XX.ics" on your desktop. If you are using a Mac, you can open your iCal program and import the file.
    • You can also import to Google Calendar
    • If you have a linux computer, or windows computer, but use an iPhone, I suggest Use Case #2

Use Case 2 (Sligtly more involved)

  1. Create a python file:
#!/usr/bin/env python3
from wmt2ics import Wmt2Ics as wmt
from wmt2ics.configemail import ConfigEmail as cfg

config = cfg() 

config.setup_config(smtp='smtp.gmail.com', port='587', send='sender@email.com', 'send_pwd='P@$$w0rd for sendemail accout', dest='receiver@email.com')

wmt(run_method='email') # will now send email with attachment

Special Note 1:

  • If you omit:
from wmt2ics.configemail import ConfigEmail as cfg
config = cfg()
config.setup_config(**kwargs)

and simply run

wmt(run_method='email')

the terminal interface will ask you for smtp,port,send,send_pwd,dest. However there are no checks and no history and no way to change what you entered in the terminal, so you will have to run

from wmt2ics.configemail import ConfigEmail as cfg
config = cfg()
config.setup_config(**kwargs)

to overwrite the file.

Special Note 2:

kwargs in setup_config have defaults set:

  • send='smtp.gmail.com'
  • port='587'
  • send_pwd = ''

If you do not include these in the setup_config(**kwargs) and only include

config.setup_config(send='', dest='')

The library will set send='smtp.gmail.com' and port='587' which are gmail settings If you leave send_pwd blank, the library will search for an env variable on your local system named GMAIL_APP_PWD. If you know how to set a persistant env variable on your local machine, this may save you some typing and be slightly more secure. Otherwise, worry not and set send_pwd = 'yourpassword'

'smtp.gmail.com' The SMTP server for the email account used to send the .ics file

'587' The port number for the SMTP server, here, i've placed the port for gmail's smtp

'sender@email.com' Here I use a gmail address to send the email, I created this email account specifically to use as a sender email for this script. You may use whatever you wish.

'password' Gmail supports "app passwords", this is where you will place the app password. if you would rather be slightly more secretive about this, if you leave it blank, the method will attempt to use an environment variable named 'GMAIL_APP_PWD' which you will have to set on your local machine. I set mine in /etc/environment, you'll have to research how to do so on Google for Windows and Mac.

'receiver@email.com' Where you want it to go!

So all that being said, you'll need to get an app password for an email account or use an account that allows using just your sign in password.

Once you run ConfigEmail().setup_config(**kwargs) once, you can comment it out, it will create a json file, if you ever need to change it, you can re-run this method

Test Web Page

a test webpage is available to download Web Test Page

Release files for Wmt2Ics 0.0.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Wmt2Ics 0.0.23
File Size Uploaded
Wmt2Ics-0.0.23.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Wmt2Ics 0.0.23
File Interpreter ABI Platform
Wmt2Ics-0.0.23-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / Wmt2Ics-0.0.23.tar.gz

Download URL Wmt2Ics-0.0.23.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
431a27c46a3359d3c8be49c4f9ff5074ef9a346e85c5d16affd7a1fd872d7f16
BLAKE2b-256 checksum
How to use checksums
11fa3e0bd03bdc440df436c1fdd18782e09b498b0f4c05abbde50694361ee64c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.10

Release files / Wmt2Ics-0.0.23-py3-none-any.whl

Download URL Wmt2Ics-0.0.23-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4d9141ab760453bd6ca30fdde9d777a83496b9949b778cd128002bdebfee69f
BLAKE2b-256 checksum
How to use checksums
b06735d107b2f7fa46f2817d1f95307107185419b41a5fef4eba647171edae4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.23 This release

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page