- Notifications
You must be signed in to change notification settings - Fork19
🏫 Python wrapper for Schoology's REST API.
License
ErikBoesen/schoolopy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Python wrapper for Schoology’s API.
You may easily installschoolopy
from PyPI withpip3 install schoolopy
.
Before any use ofschoolopy
, you'll need to import it.
importschoolopy
You'll then need to instantiate theAuth
class and, using that object, instantiate the API wrapper. There are two ways of authenticating with Schoology: two-legged and three-legged. The former is far simpler and useful for apps used by only one user who is capable of managing their own API keys, but if you're building a web app to interact with Schoology you'll need to use three-legged.
Obtain your consumer API key and secret from[Schoology URL]/api
.
# Two-leggedsc=schoolopy.Schoology(schoolopy.Auth(key,secret))sc.get_feed()# etc.
# Three-leggedauth=schoolopy.Auth(key,secret,three_legged=True,domain='https://schoology.com')# Replace URL with that of your school's Schoologyurl=auth.request_authorization()# Redirect user to that URL as appropriate for your application. Once user has performed action, continue.ifnotauth.authorize():raiseSystemExit('User not authorized!')sc=schoolopy.Schoology(auth)
More in-depth examples of both two- and three-legged authentication in action can be found inexample-twolegged.py
andexample-threelegged.py
. You will need to write your key and secret intoexample_config.yml.example
and rename that file toexample_config.yml
.
This library contains a large number of functions for interaction with the API, and listing them all would be impractical.
For a comprehensive list of what endpoints are available, consult theREST API v1 documentation.
Most objects’ functions follow a similar pattern to the following example.
[realm]
represents the name of any realm type; in this case you can usedistrict
,school
,user
,section
, orgroup
. Valid realms may vary for different objects.
event
represents anEvent
object.
sc.get_events([realm]_id=)
sc.get_[realm]_events([realm]_id)
sc.create_event(event, [realm]_id=)
sc.create_[realm]_event(event, [realm]_id)
sc.get_event(event_id, [realm]_id=)
sc.get_[realm]_events([realm]_id)
sc.update_event(event, event_id, [realm]_id=)
sc.update_[realm]_event(event, event_id, [realm]_id)
sc.delete_event(event_id, [realm]_id=)
sc.delete_[realm]_event(event_id, [realm]_id)
Note: Some methods, such as `get_courses`, are currently broken because Schoology's API has stopped providing data on the relevant endpoints.
This library was created byErik Boesen.
This software is available under theMIT License.
About
🏫 Python wrapper for Schoology's REST API.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors12
Uh oh!
There was an error while loading.Please reload this page.