Package: ucheck
ucheckAutosubmit your UCheck COVID-19 self-assessment formDisclaimerucheck automatically completes the University of Tornto's UCheck COVID-19 self-assessment form as follows:YES: "Do any of the following statements apply to you? - I am fully vaccinated against COVID-19."NO: "In the last 5 days, have you experienced any of these symptoms that are new, worsening, and not related to other known causes or conditions you already have?"NO: "Do any of the following apply? - You live with someone who is currently isolating because of a positive COVID-19 test."NO: "In the last 14 days, have you travelled outside of Canada and been told to quarantine per the federal quarantine requirements?"NO: "Has a doctor, health care provider, or public health unit told you that you should currently be isolating (staying at home)?"NO: "In the last 5 days, have you tested positive for COVID-19?"If you do not satisfy these questions as listed, DO NOT use this library to complete your UCheck form. If you're interested in making these choices customizable, please raise an issue using theissues tracker.InstallationpipinstallucheckRequirements and setupThis library usesSeleniumto complete the UCheck form. If you're new to Selenium, it takes ~5 minutes to download and set up your browser driver. View how todownload and configure a browser driver. If you're on macOS and hit permission issues, check out thisStackoverflow article.ucheck is simple to useimportosimporttimefromselenium.webdriverimportChromefromselenium.webdriver.chrome.serviceimportServicefromucheckimportUCheckif__name__=="__main__":# E.g., Save UTORid login and password as environment variables.utorid_login=os.environ["UTORID_USER"]utorid_pass=os.environ["UTORID_PASS"]withUCheck(Chrome,Service,driver_path="/opt/WebDriver/bin/chromedriver")asucheck:ucheck.complete_ucheck(utorid_login,utorid_pass)# Briefly keep browser window open before closing.time.sleep(5)Set up a Cron job to execute ucheckHere's an option to fully automate your Ucheck form submission. If you're on a *NIX computer, add the following lines to your cron configuration file:SHELL=/bin/bash08***source/path/to/ucheck_script/venv/bin/activate&&DISPLAY=:0python/path/to/ucheck_script/main.pyWhat the Cron job is doing:Everyday at 8 amActivate virtual environment to executeucheck_script/main.pyExecuteucheck_script/main.py, wheremain.pyis the demo Python script posted aboveYou can find more information about setting up a Cron jobhere.ExceptionsValid UTORid credentials are required to complete your UCheck form.importosfromselenium.webdriverimportChromefromselenium.webdriver.chrome.serviceimportServicefromucheckimportUCheckfromucheck.exceptionsimportInvalidUTORidLoginif__name__=="__main__":# Set invalid user login credentials.utorid_login="invalid-login"utorid_pass=os.environ["UTORID_PASS"]withUCheck(Chrome,Service,driver_path="/opt/WebDriver/bin/chromedriver")asucheck:try:ucheck.complete_ucheck(utorid_login,utorid_pass)exceptInvalidUTORidLoginase:print(e)ContributeIssues TrackerSource CodeSupportIf you are having issues or would like to propose a new feature, please use theissues tracker.LicenseThe project is licensed under the MIT license.