Skip to content

Education

Student, identifier, institution and print date in any order, and each term with its courses, grades, credit hours and totals.

input.txtHover a value to see its type · click it to find it in the treeRun in Studio
ILLUSTRATIVE ACADEMIC RECORD
Student: Joe Test
Student identifier: 0123456
Institution: Test University
Printed: 31-Jul-2024

Fall 2023
Code       Subject                                Grade  Hours  Points
ACCT2103   Fundamentals of Financial Acct          B      3.00   9.00
ACCT2203   Fundamentals Managerial Acct            C      3.00   6.00
ECON2213   Principles of Microeconomics            C      3.00   6.00
Term totals: attempted 9.00; earned 9.00; points 21.00; GPA 2.333

Summer 2023
Code       Subject                                Grade  Hours  Points
BUS5113    Research Methods                        B      3.00   9.00
MNGT5773   Principle-CTR Leadership & Eth           A      3.00   12.00
Term totals: attempted 6.00; earned 6.00; points 21.00; GPA 3.500
education.ymlspec
$flags: [ CASE_INSENSITIVE, MULTILINE ]

Number: '\d+(\.\d+)?'

Year: '(19|20)\d{2}'

Date:
  $local:
    Day:
      $patterns: '0[1-9]|[12]\d|3[01]'
      Single:
        $local: { Digit: '[1-9]' }
        $fields: { digit: Digit }
        $patterns: '#{digit}'
        $value: '0#{digit}'
    Month:
      Jan: { $patterns: [ 'January', 'Jan\.?' ], $value: '01' }
      Feb: { $patterns: [ 'February', 'Feb\.?' ], $value: '02' }
      Mar: { $patterns: [ 'March', 'Mar\.?' ], $value: '03' }
      Apr: { $patterns: [ 'April', 'Apr\.?' ], $value: '04' }
      May: { $patterns: 'May', $value: '05' }
      Jun: { $patterns: [ 'June', 'Jun\.?' ], $value: '06' }
      Jul: { $patterns: [ 'July', 'Jul\.?' ], $value: '07' }
      Aug: { $patterns: [ 'August', 'Aug\.?' ], $value: '08' }
      Sep: { $patterns: [ 'September', 'Sept?\.?' ], $value: '09' }
      Oct: { $patterns: [ 'October', 'Oct\.?' ], $value: '10' }
      Nov: { $patterns: [ 'November', 'Nov\.?' ], $value: '11' }
      Dec: { $patterns: [ 'December', 'Dec\.?' ], $value: '12' }
      Number:
        $patterns: '0[1-9]|1[0-2]'
        Single:
          $local: { Digit: '[1-9]' }
          $fields: { digit: Digit }
          $patterns: '#{digit}'
          $value: '0#{digit}'
  $fields: { day: Day, month: Month, year: Year }
  $value: '#{year}-#{month}-#{day}'

  DayMonthYear:
    $patterns: '#{day}[ -]#{month}[-, ]{1,2}#{year}'

  MonthDayYear:
    $patterns: '#{month} #{day},? #{year}'

  Numeric:
    $patterns: '#{month:Month::Number}/#{day}/#{year}'

  Iso:
    $patterns: '#{year}-#{month:Month::Number}-#{day}'

Season:
  Fall: { $patterns: [ 'Fall', 'Autumn' ], $value: 'Fall' }
  Winter: { $patterns: 'Winter', $value: 'Winter' }
  Spring: { $patterns: 'Spring', $value: 'Spring' }
  Summer: { $patterns: 'Summer', $value: 'Summer' }

TermName:
  $local: { Unit: 'Semester|Term|Quarter|Session' }
  $fields: { season: Season, year: Year }
  $patterns:
    - '#{season}( ${Unit})? #{year}'
    - '#{year} #{season}( ${Unit})?'
  $value: '#{season} #{year}'

Detail:
  $local: { Name: '[^\s:][^\n:]*[^\s:]' }

Detail::StudentName:
  $local:
    Label: [ 'Student', 'Student name', 'Name' ]
  $fields: { name: Name }
  $patterns: '^${Label} *: *#{name} *$'
  $value: '#{name}'

Detail::StudentId:
  $local:
    Label: [ 'Student identifier', 'Student ID', 'Student number', 'Student no\.?', 'ID', 'ID number', 'ID no\.?' ]
    Id: '[A-Z0-9][A-Z0-9-]{2,}'
  $fields: { id: Id }
  $patterns: '^${Label} *: *#{id} *$'
  $value: '#{id}'

Detail::Institution:
  $local:
    Label: [ 'Institution', 'School', 'College', 'University' ]
  $fields: { name: Name }
  $patterns: '^${Label} *: *#{name} *$'
  $value: '#{name}'

Detail::PrintDate:
  $local:
    Label: [ 'Printed', 'Printed on', 'Print date', 'Date printed', 'Issued', 'Date issued', 'Issue date' ]
  $fields: { date: Date }
  $patterns: '^${Label} *: *#{date} *$'
  $value: '#{date}'

Course:
  $local:
    Code: '[A-Z]{2,5} ?-?\d{3,4}[A-Z]?'
    Title: '\S.*\S|\S'
    Grade:
      $flags: [ -CASE_INSENSITIVE ]
      $patterns: [ '[A-D][+-]?', 'F', 'P', 'NP', 'S', 'U', 'W', 'WF', 'I', 'IP', 'CR', 'NC', 'AU' ]
    CodeHeader: [ '^Code$', '^Course$', 'Course code', 'Course no\.?', 'Course number', 'Course ID' ]
    TitleHeader: [ 'Subject', 'Title', 'Course title', 'Description', 'Course name' ]
    GradeHeader: [ '^Grade$', '^Grd$' ]
    HoursHeader: [ 'Hours', 'Hrs', 'Credits?', 'Credit hours', 'Units' ]
    PointsHeader: [ 'Points', 'Pts', 'QPts', 'Quality points', 'Grade points' ]
  $fields: { code: Code, title: Title, grade: Grade, hours: Number, points: Number }
  $tables:
    $columns:
      code: CodeHeader
      title: TitleHeader
      grade: GradeHeader
      hours: HoursHeader
      points: PointsHeader

Totals:
  $local:
    Attempted: [ 'attempted', 'hours attempted', 'credits attempted', 'att hrs' ]
    Earned: [ 'earned', 'hours earned', 'credits earned', 'earned hrs' ]
    Points: [ 'points', 'quality points', 'grade points', 'QPts' ]
    Gpa: [ 'GPA', 'term GPA', 'grade point average' ]
    Gap: ' *[;,]? +'
  $fields: { attempted: Number, earned: Number, points: Number, gpa: Number }
  $patterns: '^${Label} *:? *${Attempted} *:? *#{attempted}${Gap}${Earned} *:? *#{earned}${Gap}${Points} *:? *#{points}${Gap}${Gpa} *:? *#{gpa} *$'

  Term: { $local: { Label: [ 'Term totals', 'Term total', 'Semester totals', 'Term' ] } }

  Cumulative: { $local: { Label: [ 'Cumulative totals', 'Cumulative', 'Cum totals', 'Overall' ] } }

Term:
  $fields:
    name: TermName
    courses: { $type: 'Course[]', $separator: '\n' }
    totals: Totals::Term
    cumulative: Totals::Cumulative
  $patterns: '^#{name}\n#{courses}(\n#{totals})?(\n#{cumulative})?'

Transcript:
  $local: { Other: '^[^\n:]*[^\s:] *: *[^\n]*[^\s]' }
  $fields:
    student: Detail::StudentName
    id: Detail::StudentId
    institution: Detail::Institution
    printed: Detail::PrintDate
    terms: { $type: 'Term[]', $separator: '\n\s*' }
  $patterns: '((#{student}|#{id}|#{institution}|#{printed}|${Other})\n)+\s*#{terms}'
$ texomy parse input.txt -m education
education.json
[
  {
    "type": "Transcript",
    "start": 29,
    "end": 774,
    "fields": {
      "student": {
        "type": "Detail::StudentName",
        "start": 29,
        "end": 46,
        "fields": {
          "name": {
            "type": "Name",
            "start": 38,
            "end": 46,
            "text": "Joe Test"
          }
        },
        "value": "Joe Test"
      },
      "id": {
        "type": "Detail::StudentId",
        "start": 47,
        "end": 74,
        "fields": {
          "id": {
            "type": "Id",
            "start": 67,
            "end": 74,
            "text": "0123456"
          }
        },
        "value": "0123456"
      },
      "institution": {
        "type": "Detail::Institution",
        "start": 75,
        "end": 103,
        "fields": {
          "name": {
            "type": "Name",
            "start": 88,
            "end": 103,
            "text": "Test University"
          }
        },
        "value": "Test University"
      },
      "printed": {
        "type": "Detail::PrintDate",
        "start": 104,
        "end": 124,
        "fields": {
          "date": {
            "type": "Date::DayMonthYear",
            "start": 113,
            "end": 124,
            "fields": {
              "day": {
                "type": "Day",
                "start": 113,
                "end": 115,
                "text": "31"
              },
              "month": {
                "type": "Month::Jul",
                "start": 116,
                "end": 119,
                "text": "Jul",
                "value": "07"
              },
              "year": {
                "type": "Year",
                "start": 120,
                "end": 124,
                "text": "2024"
              }
            },
            "value": "2024-07-31"
          }
        },
        "value": "2024-07-31"
      },
      "terms": [
        {
          "type": "Term",
          "start": 126,
          "end": 482,
          "fields": {
            "name": {
              "type": "TermName",
              "start": 126,
              "end": 135,
              "fields": {
                "season": {
                  "type": "Season::Fall",
                  "start": 126,
                  "end": 130,
                  "text": "Fall",
                  "value": "Fall"
                },
                "year": {
                  "type": "Year",
                  "start": 131,
                  "end": 135,
                  "text": "2023"
                }
              },
              "value": "Fall 2023"
            },
            "courses": [
              {
                "type": "Course",
                "start": 207,
                "end": 276,
                "fields": {
                  "code": {
                    "type": "Code",
                    "start": 207,
                    "end": 215,
                    "text": "ACCT2103"
                  },
                  "title": {
                    "type": "Title",
                    "start": 218,
                    "end": 248,
                    "text": "Fundamentals of Financial Acct"
                  },
                  "grade": {
                    "type": "Grade",
                    "start": 258,
                    "end": 259,
                    "text": "B"
                  },
                  "hours": {
                    "type": "Number",
                    "start": 265,
                    "end": 269,
                    "text": "3.00"
                  },
                  "points": {
                    "type": "Number",
                    "start": 272,
                    "end": 276,
                    "text": "9.00"
                  }
                }
              },
              {
                "type": "Course",
                "start": 277,
                "end": 346,
                "fields": {
                  "code": {
                    "type": "Code",
                    "start": 277,
                    "end": 285,
                    "text": "ACCT2203"
                  },
                  "title": {
                    "type": "Title",
                    "start": 288,
                    "end": 316,
                    "text": "Fundamentals Managerial Acct"
                  },
                  "grade": {
                    "type": "Grade",
                    "start": 328,
                    "end": 329,
                    "text": "C"
                  },
                  "hours": {
                    "type": "Number",
                    "start": 335,
                    "end": 339,
                    "text": "3.00"
                  },
                  "points": {
                    "type": "Number",
                    "start": 342,
                    "end": 346,
                    "text": "6.00"
                  }
                }
              },
              {
                "type": "Course",
                "start": 347,
                "end": 416,
                "fields": {
                  "code": {
                    "type": "Code",
                    "start": 347,
                    "end": 355,
                    "text": "ECON2213"
                  },
                  "title": {
                    "type": "Title",
                    "start": 358,
                    "end": 386,
                    "text": "Principles of Microeconomics"
                  },
                  "grade": {
                    "type": "Grade",
                    "start": 398,
                    "end": 399,
                    "text": "C"
                  },
                  "hours": {
                    "type": "Number",
                    "start": 405,
                    "end": 409,
                    "text": "3.00"
                  },
                  "points": {
                    "type": "Number",
                    "start": 412,
                    "end": 416,
                    "text": "6.00"
                  }
                }
              }
            ],
            "totals": {
              "type": "Totals::Term",
              "start": 417,
              "end": 482,
              "fields": {
                "attempted": {
                  "type": "Number",
                  "start": 440,
                  "end": 444,
                  "text": "9.00"
                },
                "earned": {
                  "type": "Number",
                  "start": 453,
                  "end": 457,
                  "text": "9.00"
                },
                "points": {
                  "type": "Number",
                  "start": 466,
                  "end": 471,
                  "text": "21.00"
                },
                "gpa": {
                  "type": "Number",
                  "start": 477,
                  "end": 482,
                  "text": "2.333"
                }
              }
            }
          }
        },
        {
          "type": "Term",
          "start": 484,
          "end": 774,
          "fields": {
            "name": {
              "type": "TermName",
              "start": 484,
              "end": 495,
              "fields": {
                "season": {
                  "type": "Season::Summer",
                  "start": 484,
                  "end": 490,
                  "text": "Summer",
                  "value": "Summer"
                },
                "year": {
                  "type": "Year",
                  "start": 491,
                  "end": 495,
                  "text": "2023"
                }
              },
              "value": "Summer 2023"
            },
            "courses": [
              {
                "type": "Course",
                "start": 567,
                "end": 636,
                "fields": {
                  "code": {
                    "type": "Code",
                    "start": 567,
                    "end": 574,
                    "text": "BUS5113"
                  },
                  "title": {
                    "type": "Title",
                    "start": 578,
                    "end": 594,
                    "text": "Research Methods"
                  },
                  "grade": {
                    "type": "Grade",
                    "start": 618,
                    "end": 619,
                    "text": "B"
                  },
                  "hours": {
                    "type": "Number",
                    "start": 625,
                    "end": 629,
                    "text": "3.00"
                  },
                  "points": {
                    "type": "Number",
                    "start": 632,
                    "end": 636,
                    "text": "9.00"
                  }
                }
              },
              {
                "type": "Course",
                "start": 637,
                "end": 708,
                "fields": {
                  "code": {
                    "type": "Code",
                    "start": 637,
                    "end": 645,
                    "text": "MNGT5773"
                  },
                  "title": {
                    "type": "Title",
                    "start": 648,
                    "end": 678,
                    "text": "Principle-CTR Leadership & Eth"
                  },
                  "grade": {
                    "type": "Grade",
                    "start": 689,
                    "end": 690,
                    "text": "A"
                  },
                  "hours": {
                    "type": "Number",
                    "start": 696,
                    "end": 700,
                    "text": "3.00"
                  },
                  "points": {
                    "type": "Number",
                    "start": 703,
                    "end": 708,
                    "text": "12.00"
                  }
                }
              }
            ],
            "totals": {
              "type": "Totals::Term",
              "start": 709,
              "end": 774,
              "fields": {
                "attempted": {
                  "type": "Number",
                  "start": 732,
                  "end": 736,
                  "text": "6.00"
                },
                "earned": {
                  "type": "Number",
                  "start": 745,
                  "end": 749,
                  "text": "6.00"
                },
                "points": {
                  "type": "Number",
                  "start": 758,
                  "end": 763,
                  "text": "21.00"
                },
                "gpa": {
                  "type": "Number",
                  "start": 769,
                  "end": 774,
                  "text": "3.500"
                }
              }
            }
          }
        }
      ]
    }
  }
]

About this spec

Academic transcripts: the student, identifier, institution and print date in any order, and per term the courses (code, title, grade, credit hours, grade points) with the term and cumulative totals.

Package files

  • education.yml
  • samples/in-progress.txt
  • samples/prose.txt
  • samples/variant.txt
  • tests/education.test.yml
  • tests/expected/in-progress.yaml
  • tests/expected/original.yaml
  • tests/expected/variant.yaml
  • texomy.json

60 nodes from 1 top-level matches.

Run it yourself

Save the example from Studio to a folder, then in that folder:

texomy parse input.txt -m education
texomy test

Write the spec once. Run it on everything.

Install the CLI, connect your agent, and turn your first sample into typed data in minutes.

brew install texomy/tap/texomy