📌
MBPY: Schools Technology
  • About this Resource
  • Installation
    • Requirements
    • Getting Started Local Install
    • Getting Started using Docker
    • Further instructions with Docker
    • Updating with Docker
  • Tutorials
    • Configuration
    • Importing
    • Extracting
    • Streaming
    • Pipelines
    • Scripting
    • Big Query
  • Querying & Tranformations
    • Querying Commands
    • Querying the Database
    • Querying via Script
    • Querying via an SQLite Client
  • Scripts
    • Daily Homeroom Attendance Report
  • Pipelines
    • Dataframes with pandas
    • Pipelines
    • Example Pipelines
      • Bulk Change Email domain
      • Enrollment by Gender
  • Plugins
    • mbpy_powerschool_plugin
      • PowerSchool Plugin
        • API reference
      • mbpy Plugin
        • mbpy plugin source code
    • Plugins Overview
    • mbpy_plugin_example
    • mbpy_plugin_destiny
    • mbpy_plugin_attendance_reports
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Pipelines
  2. Example Pipelines

Bulk Change Email domain

PreviousExample PipelinesNextEnrollment by Gender

Last updated 2 years ago

Was this helpful?

Change e-email domain

When domain names change, all of the users need to be updated. This pipeline asks for user input, demonstrates what actions it will take, updates the user table accordingly, and then outputs a report.

Using --help to discover what inputs this command requires:

The only required parameter is --users:

mbpy pipelines change-email-domain --users students

The script will then ask you to input the values needed

The value to change (after the @): example.com
The value to change it to: subdomain.example.com

It will then download from the API, and present the selected users that will potentially be changed:

As we can see, there are lots of active students with this email address. The next step will display the first 10 and last 10 records that will be changed (not real student information):

That gives us the confidence that it is doing example what we are expecting it to do.

The operation to make the necessary API calls (PATCH on /students/{id} endpoint) commenses, with a progress bar:

Once the operation is complete, it provides a simple table indicating status code:

Finally, it provides a report of all actions that were taken. In a support context, this report can be sent back to schools for confirmation:

Notice that it automatically selects students whose email address matches
List of all the requests that will be enacted via the API
The user needs to confirm before proceeding
Just confirms that there were no unexpected errors
Notice the response includes the updated email address, indicating it was changed.