/covidpyss

Python API and CLI for MIT COVID Pass

Primary LanguagePythonMIT LicenseMIT

Covidpyss

This project consists of a python API (covidpass_api.py) and a command-line interface (covidpass.py) for MIT COVID Pass.

Main features:

  • Submitting daily attestation.
  • Submitting at-home COVID test.
  • Checking your covidpass status.
  • Checking your test results.
  • Listing testing locations and their hours.

CLI

  1. Install the dependencies (pip install dataclasses-json touchstone-auth).
  2. Generate a certificate file from https://ca.mit.edu.
  3. Create a credentials.json file with a path to your certificate and its password (not your kerberos password!):
    {
      "certfile": "./cert.p12",
      "password": "correct horse battery staple"
    }
    
    See touchstone-auth readme for more details.
  4. Run ./covidpass.py help to see the list of available commands.

The first time you run it (and once a month after that), you'll need to accept the Duo notification on your phone.

The credentials.json file can be located in the same directory as covidpass.py or in your current working directory. A cookies.json file will be created/updated in the same directory, to keep your Duo authentication.

API

If you want to use the API, look at what covidpass.py does, and do the same.