#!/usr/bin/env python
import pandas as pd
import sys
from pathlib import Path
import warnings    
warnings.simplefilter("ignore")
from mirri.validation.excel_validator import validate_mirri_excel

def main():
    path = Path(sys.argv[1])
    version = str(sys.argv[2])
    try:

        error_log = validate_mirri_excel(path.open("rb"), version=version)
        
    except NotImplementedError as e:
        print(e)    

    for errors in error_log.get_errors().values():
        for error in errors:
            print(error.pk, error.message, error.code)


if __name__ == "__main__":
    main()