Skip to content

cityssm/wsib-clearance-check-csv-cli

Repository files navigation

wsib-clearance-check-csv-cli

Codacy Badge Maintainability GitHub Workflow Status Snyk Vulnerabilities for GitHub Repo

A command line tool to simplify retrieving clearance certificates from the WSIB website.

Looking to tie WSIB clearance certificate lookups into your own project? Check out the wsib-clearance-check project.

Usage

node lookup
     -input [inputFile.txt | inputFile.csv | inputFile.xlsx]
     -output [outputFile.csv]
     -error [errorFile.csv]
     [-real]

Parameters

-input [inputFile.txt | inputFile.csv | inputFile.xlsx] or
-i [inputFile.txt | inputFile.csv | inputFile.xlsx]

  • Specifies the path to the file that should be parsed.

  • The file can be either a simple text file with one WSIB Account Number on each line, a CSV file with the WSIB Account Number in the first column, or an XLSX file with the WSIB Account Number in the first column of the first sheet.

-output [outputFile.csv] or -o [outputFile.csv]

  • Specifies the name of the CSV file that should contain successfully retrieved clearance certificates.

  • This file is only written if there are records to write.

  • The output file includes the following fields. See a sample output file.

    • accountNumber
    • contractorLegalTradeName
    • contractorAddress
    • clearanceCertificateNumber
    • validityPeriodStart
    • validityPeriodEnd
    • principalLegalTradeName
    • principalAddress
    • certificateURL

-error [errorFile.csv] or -e [errorFile.csv]

  • Specifies the name of the CSV file that should contain error messages.

  • This file is only written if there are errors to write.

  • The error file includes the following fields. See a sample error file.

    • accountNumber
    • error
    • errorURL

-real or -r

  • Runs in "real browser" mode, as opposed to "headless browser" mode.

  • Useful for debugging, but not recommended for production use.

Setup

Ensure system has NodeJS 14 or better installed.

Download the latest code from this repository. This can be done from this website, from a git command line, or using GitHub Desktop. Save to the folder of your choice.

Install the dependencies.

npm install

See if it works.

npm test

🙏 Thanks

This project was developed in collaboration with FRANCOachat, an organization that provides procurement services to several Ontario school boards.