Changes

Jump to: navigation, search

OPS435 Python Assignment 3

3,425 bytes added, 14:23, 16 November 2018
Rubric
Name your Python3 script as <code>ccn_[student_id].py</code>. Create a symbolic link to your script as ccn.py (e.g. use the command ln -s ccn_rchan.py ccn.py to create the link) so that you can refer to your script as ccn.py. Your script must accept one or more "web site" as its command line parameters and other optional parameters as shown below. Your python script should produce the following usage text when run with the --help option:
<pre>
[rchan@centos7 a1]$ python3 ./ccn.py -husage: ccn.py [-h] [-s SITE] [-t {table,text}] [-n CCN {table,text}] F N [F N ...]
Class Cancellation Notification System
positional arguments:
F N list of CCN notification subscription web pagessites to be processed.
optional arguments:
-h, --help show this help message and exit
-c s SITE, --site SITE class USER Class Cancellation cancellation web site -vt {table,text}, --type {table,text} type of class concellation data: table -> html table, text -> plain text file -n {table,text}, --notification {table, text} type of notification data: table -> html table, text -verbose tune on output verbosity> plain text file
Copyright 2018 - Raymond Chan
</pre>
Replace the last line with your own full name
If there is more than one CCN subscription web page provided, merge all the subscription list with the first one at the top and the last one at the bottom. Read and process the subscription list in that order in your program.
 
If no class cancellation site specified, default to https://scs.senecac.on.ca/~raymond.chan/ops435/a3/ccn.html.
 
If no -t or -n specified, default to html table.
 
Sample subscription site: https://wiki.cdot.senecacollege.ca/wiki/OPS435_Python_A3_CCN_Subscription
=== Header ===
 
All your Python codes for this assignment must be placed in a <font color='red'><b><u>single source file</u></b></font>. Please include the following declaration by <b><u>you</u></b> as the script level docstring in your Python source code file (replace [Student_id] with your Seneca email user name, and "Student Name" with your own name):
 
<source>OPS435 Assignment 3 - Fall 2018
Program: ccn_[Stduent_id].py
Author: "Student Name"
The python code in this file ccn_[Student_id].py is original work written by
"Student Name". No code in this file is copied from any other source
including any person, textbook, or on-line resource except those provided
by the course instructor. I have not shared this python file with anyone
or anything except for submission for grading.
I understand that the Academic Honesty Policy will be enforced and violators
will be reported and appropriate action will be taken.
</source>
 
=== Modules you are allowed to use in your script for this assignment ===
* the <b>os, sys</b> modules
* the <b>argparse</b> module
** [https://docs.python.org/3/howto/argparse.html Argparse Tutorial] - should read this first.
** [https://docs.python.org/3/library/argparse.html Argparse API reference information page]
* the <b>time</b> module
** [https://www.tutorialspoint.com/python3/python_date_time.htm Time module Tutorial]
** [https://docs.python.org/3/library/time.html Time module API reference page]
 
=== Sample Output ===
You python script should check the class cancellation notification site for any classes cancellation that are going to happen in the next 24 hours. If it identifies any classes, it should check the class cancellation notification subscription sites for any matches. If there is any matches, it should send an appropriate email to the subscriber using the following template:
 
<pre>
Dear <subscriber full name>,
Your <class code> scheduled on <data and time> is being cancellated. Details about the cancellation can be found and confirm at <Class Cancellation Notification site>.
 
Your class cancellation notification team.
Message generated on <Date and time stamp>
</pre>
 
The sample message should also written to your CCN log file named ccn.log.
 
== Rubric ==
 
{| class="wikitable" border="1"
! Task !! Maximum mark !! Actual mark
|-
| Program Authorship Declaration ||1 ||
|-
| Program usage || 2 ||
|-
| Program Options || 2 ||
|-
| Generate correct notification email || 5 ||
|-
| Generate and keep correct email message in log|| 5 ||
|-
| Function to extract and produce class cancellation data || 5 ||
|-
| Function to extract and produce notification subscription data || 5 ||
|-
| '''Total''' || 25 ||
 
|}
== Submission ==
After fully testing your program, submit your python script ccn_[student_id].py on Blackboard by November 30, 2018.
1,760
edits

Navigation menu