zeba_books_syllabus_parser

Automates extraction of course schedules and grading data from unstructured syllabi. Ideal for academic tools, calendar integrations, and AI-driven data processing.


Features

  • Fuzzy Header Detection – Detect headers like "Course Schedule" or "Grading Policy" even with typos.
  • Schedule Extraction – Convert messy date strings (e.g., Oct 12th, Week 4 Monday) into Dart DateTime.
  • Grading Audit – Validate grading weights automatically.
  • Table Extraction – Parse HTML tables or plain text tables into structured Dart Maps.
  • JSON-ready Output – Export schedules and grades as JSON, compatible with Google Calendar or Notion APIs.

Installation

Add this to your pubspec.yaml:

dependencies:
  zeba_books_syllabus_parser:
    git:
      url: https://github.com/YOUR_USERNAME/zeba_books_syllabus_parser.git

Then run:

flutter pub get

Usage Example

import 'package:zeba_books_syllabus_parser/zeba_books_syllabus_parser.dart';

void main() {
  final rawText = """
Course Schedule
Oct 12 - Introduction
Oct 14 - Lecture 2

Grading Policy
Homework 40
Project 60
""";

  final scanner = SyllabusScanner(rawText);
  final scheduleSection = scanner.extractSection('Course Schedule')!;
  final gradingSection = scanner.extractSection('Grading Policy')!;

  final schedule = ScheduleExtractor().extractFromText(scheduleSection);
  for (var item in schedule) {
    print(item.toJson());
  }

  final gradingItems = gradingSection
      .split('\n')
      .where((line) => line.trim().isNotEmpty)
      .map((line) {
        final parts = line.split(RegExp(r'\s+'));
        final component = parts.sublist(0, parts.length - 1).join(' ').trim();
        final weight = double.tryParse(parts.last.trim()) ?? 0.0;
        return GradingItem(component: component, weight: weight);
      })
      .toList();

  final audit = GradingAudit(gradingItems);
  print('Total Weight: ${audit.totalWeight()}');
  print('Is grading valid? ${audit.isValid()}');
}

Running Tests

flutter test

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.