Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🏫 Python wrapper for Schoology's REST API.

License

NotificationsYou must be signed in to change notification settings

ErikBoesen/schoolopy

Repository files navigation

Python wrapper for Schoology’s API.

Installation

You may easily installschoolopy from PyPI withpip3 install schoolopy.

Setup & Authorization

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)

Example

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.

Methods

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.

Author

This library was created byErik Boesen.

Licensing

This software is available under theMIT License.

About

🏫 Python wrapper for Schoology's REST API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp