Skip to content

An unofficial Python client library for the EdStem API, enabling asynchronous event handling and automation of actions based on Ed course activities.

Notifications You must be signed in to change notification settings

bachtran02/edpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

edspy

An (unofficial) wrapper for Ed API in Python. As the main goal of the module is to listen to Ed's websocket connections for events, most of the methods are asynchronous. This library may be useful if you are looking to automate actions that should be executed should a specific event be sent from an Ed course.

If you're looking for a synchronous Python library of Ed API, consider checking out this repo which I also used as reference for building this library.

Events currently supported:

  • New course thread is created.
  • Course thread is updated.
  • Course thread is deleted.
  • Comment on a thread is created.
  • Comment on a thread is updated.
  • Comment on a thread is deleted.
  • The number of students online in a course page changes.

Installation

You can either git clone or git submodule add this repo inside of your project.

Usage

The bare minimum to utilize the API integration is to create a .env file in your project storing your API key, or store the API key in an environment variable in an equivalent manner.

ED_API_TOKEN=your-token-here

You can also directly pass your API key as an argument when creating an EdClient() object.

from edspy import edspy

client = edspy.EdClient(ed_token='your-token-here')

Your API key can be created through https://edstem.org/us/settings/api-tokens.

Note: The API key should be kept secret, and not committed through any version control system as it acts as an authorization for any Ed usage on behalf of your account.

Some simple example usages of this module can be found here.

For a more advanced usage, I currently use this library to send notification whenever a new course thread is created to Discord via Discord webhooks. You can checkout the repo here.

Additional possible use cases

  • Logging students & course staff activities on Ed.
  • (to be updated)

About

An unofficial Python client library for the EdStem API, enabling asynchronous event handling and automation of actions based on Ed course activities.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages