Pipelines

Using

Pipelines are like saved queries. They produce a data set that would otherwise be a very long command.

View

Pipelines come with some built-in, and can be installed via plugins. To see what is currently available:

mbpy pipelines --help

For example:

mbpy pipelines enrollment-breakdown

Which outputs the following:

                                       count
class_grade_number class_grade gender
2                  PS 1        Female     8
                               Male       2
4                  PS 3        Female     7
                               Male       3
                   PYP 3       Female     5
                               Male       3
5                  PS 4        Female     7
                               Male      13
6                  PS 5        Female     6
                               Male      14
7                  MS 6        Female     4

Pipelines can also be used with the EXTRACT keyword, which will let allow you to pass it to a loader. Let's load it with our pretty printer PPRINT:

mbpy \
    EXTRACT \
        from-pipeline \
            --name enrollment-breakdown \
    PPRINT
  class_grade_number          β”‚ class_grade       β”‚ gender     β”‚ count
╢─────────────────────────────┼───────────────────┼────────────┼─────────╴
  2                           β”‚ PS 1              β”‚ Female     β”‚ 8
╢─────────────────────────────┼───────────────────┼────────────┼─────────╴
  2                           β”‚ PS 1              β”‚ Male       β”‚ 2
╢─────────────────────────────┼───────────────────┼────────────┼─────────╴
  4                           β”‚ PS 3              β”‚ Female     β”‚ 7
╢─────────────────────────────┼───────────────────┼────────────┼─────────╴
  4                           β”‚ PS 3              β”‚ Male       β”‚ 3
╢─────────────────────────────┼───────────────────┼────────────┼─────────╴
  4                           β”‚ PYP 3             β”‚ Female     β”‚ 5
╢─────────────────────────────┼───────────────────┼────────────┼─────────╴
  4                           β”‚ PYP 3             β”‚ Male       β”‚ 3
╢─────────────────────────────┼───────────────────┼────────────┼─────────╴
  5                           β”‚ PS 4              β”‚ Female     β”‚ 7
╢─────────────────────────────┼───────────────────┼────────────┼─────────╴
  5                           β”‚ PS 4              β”‚ Male       β”‚ 13
╢─────────────────────────────┼───────────────────┼────────────┼─────────╴
  6                           β”‚ PS 5              β”‚ Female     β”‚ 6
╢─────────────────────────────┼───────────────────┼────────────┼─────────╴
...

Last updated