block-quote On this pagechevron-down
copy Copy chevron-down
Tutorials Extracting About Extracting
After importing, the data can be queried through the command line. For example:
Copy mbpy EXTRACT from-users PRINT That will produce screens that display the first 5, and last 5 student records, and every column in the student table for those records.
Copy id role oa_id sb_id account_uid
0 10752543 Admin None None None \
1 10752544 Admin None None None
2 10752545 Advisor None None None
3 10752546 Admin None None None
4 10752547 Advisor None None None Scroll down to see more columns for these records. (Notice the \ indicates there is wraparound.)
These commands can be used to just get data displayed, but it becomes interesting when paired with available commands to perform manipulations. For example, to find the distribution of users' domains, we could do the following:
Copy mbpy \
EXTRACT \
from-users \
--fields email \
INFO \
--value-count domain \
extract-on \
--column email \
--pattern '^(?P<handle>.+)@(?P<domain>.+)$' This school is supposed to have only eduvo.com accounts. Looks like we have a few users with wrong email addresses! Let's find them:
Let's see what we got:
Let's limit to only those that are active (not archived), and let's give ourselves a link we can click:
Command-click to load the url in the browser!
The structure of these commands are the following:
To learn more about how to query with extractors, continue to Querying Commands:
Querying Commands chevron-right