Skip to content

This program allows for users to acquire their To-Do Assignments on Canvas and have a message be sent through SMS as well as giving the weather, and a motivational quote. This program does not run on it's own. I suggest using a crontab on a VM to achieve equivelant output.

Notifications You must be signed in to change notification settings

carsonful/canvascalendar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Canvas Assignment Messenger

If you'd like to contact me please looked at my ReadMe on how to reach me.


Table of Contents

All sections regarding this repository.


Tutorial

Full tutorial: https://www.youtube.com/watch?v=b05p2Rhmn4w


Description

This program allows for users to acquire their To-Do Assignments on Canvas and have a message be sent through SMS as well as giving the weather, and a motivational quote. This program does not run on it's own. I suggest using a crontab on a VM to achieve equivalent output.

For example:

APIs

  • TextNowAPI
  • CanvasAPI
  • OpenWeatherAPI

Back To The Top


How To Use

Installation

To be able to execute this code you will need these modules:

  • PyTextNow
  • Datetime
  • Time
  • CanvasAPI
  • Random
  • Pandas

API Reference

    from canvasapi import Canvas
    from datetime import datetime, timedelta
    import pandas as pd
    import keys

    # Canvas API URL
    API_URL = keys.schoolurl
    # Canvas API key
    API_KEY = keys.accounttoken

    canvas = Canvas(API_URL, API_KEY)
    def getassignments():
        #gets the users todo assignments
        pendingAssigments = canvas.get_todo_items()
        #list with assignment and due date 
        lst = []
        # for loop getting every upcoming assignment
        for assignment in pendingAssigments:

            #gets the name of the assignments
            name = assignment.assignment["name"]

            #gets the time of assignment and subtracts five hours (canvas defaults to GMT I'm EST) - Also assignment is an object 
            # you can call various things from such as ["description"] and etc.
            due = datetime.strptime(assignment.assignment["due_at"], "%Y-%m-%dT%H:%M:%SZ") - timedelta(hours=5)

            #gets the \day of the week
            temp = pd.Timestamp(due)

            #adds the name, time, and day in a list of lists
            lst.append([name, temp.day_name(), str(temp)])

        return lst 
        

Back To The Top


References

Back To The Top


License

MIT License

Copyright (c) [2022] [Carson Fulmer]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Back To The Top


Author Info

Back To The Top

About

This program allows for users to acquire their To-Do Assignments on Canvas and have a message be sent through SMS as well as giving the weather, and a motivational quote. This program does not run on it's own. I suggest using a crontab on a VM to achieve equivelant output.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages