How ethandf/marc_batchloading_checks works
Project type and purpose
• From the file tree and README: this is a small, open-source, command-line Python tool (“marcCheck.py”) for batch-loading error checks on MARC records. It runs a sequence of “F” checks defined by Traill’s 2013 paper and will eventually support in-place updates and reporting.
File structure
• Top-level files:
• marcCheck.py – the main script that orchestrates parsing, checking, and (future) updating/reporting
• Notes_On_Error_Checks.md – developer notes on the checks you implement
• README.md – user-facing description, goals, and roadmap
• No frontend/backend split, no services—just one executable module plus docs.
README for additional insights
• Purpose: Validate and (eventually) fix MARC fields in batch
• Future plans: automated updates, reporting tools to track changes
a. Main components
1. CLI / Entry Point (marcCheck.py)
2. MARC Parser (e.g., pymarc or custom reader)
3. Error-Check Module(s)
– One function/class per “F”-type check—e.g., missing subfields, bad indicators
4. Reporter / Output Module
– Console stdout, CSV, JSON or log file
5. (Future) Updater Module
– Applies corrections back to the MARC file or exports a new file
6. Configuration / Rules Store
– Could be YAML/JSON or the Notes_On_Error_Checks.md source
b. Relationships & data flow
• Input MARC file → CLI
• CLI → Parser → Stream of Record objects
• For each Record → Error-Check Module(s) → List of Findings
• Findings → Reporter → stdout/logs/CSV
• Optional: Findings + Record → Updater → New MARC output
c. Architectural patterns and principles
• Pipeline pattern: sequential record processing
• Modular checks: each rule lives in its own function or class for ease of extension
• Single responsibility: parser only reads records, reporter only writes results, checks only inspect
d. Key technologies and libs
• Python 3.x
• pymarc (or similar) for MARC parsing
• argparse or click for CLI
• CSV/JSON stdlib for reporting
• Future: logging library for detailed logs