2023-05-31 12:45:29 -06:00
# Covid Passport Decoder
2021-05-24 16:06:49 -06:00
2023-05-31 12:45:29 -06:00
Forked from [ggqc007/Covid-QR-Decoder ](https://github.com/ggqc007/Covid-QR-Decoder ). Removed the JS version and improved the Py version.
2021-05-24 16:06:49 -06:00
2023-05-31 12:45:29 -06:00
* * *
2021-05-24 16:06:49 -06:00
2023-05-31 12:45:29 -06:00
A simple commandline tool to extract the data from a Covid-19 QR code in the SMART Health Card format. Displays the data with fancy formatting. No error checking is preformed.
Sample code is included to validate the QR code. Requires the public key from an authority (probably the government).
2021-05-24 16:06:49 -06:00
More info about the SMART Health Cards Framework can be found here:
2023-05-31 12:45:29 -06:00
< https: / / spec . smarthealth . cards / >
* * *
2021-05-24 16:06:49 -06:00
2023-05-31 12:45:29 -06:00
# Usage
2021-05-24 16:06:49 -06:00
2023-05-31 12:45:29 -06:00
1. `pip install python-jose pyzbar rich`
2. `./covid-qr-decode.py [path to QR code]`
2021-05-24 16:06:49 -06:00
2023-05-31 12:45:29 -06:00
**Raw QR Code Data**: You can specify `--raw` to enter the raw QR code data instead of the path to a QR file.
2021-05-24 16:06:49 -06:00
2023-05-31 12:45:29 -06:00
**Validate:** To validate the QR code signature, add `--validate [path to public key]` .
2021-05-24 16:06:49 -06:00
2023-05-31 12:45:29 -06:00
# Sample Data Output
2021-05-24 16:06:49 -06:00
2023-05-31 12:45:29 -06:00
```json
{"kid":"SOME-KEY-ID","zip":"SOME-ZIP","alg":"ES256"}
{
2021-05-24 16:06:49 -06:00
"resource": {
"resourceType": "Patient",
"name": [
{
"family": [
"NAME"
],
"given": [
"SURNAME"
]
}
],
"birthDate": "1900-01-01",
"gender": "SEX"
}
}
{
"resource": {
"resourceType": "Immunization",
"vaccineCode": {
"coding": [
{
"system": "http://hl7.org/fhir/sid/cvx",
"code": "208"
}
]
},
"patient": {
"reference": "resource:0"
},
"lotNumber": "SOME-LOT-NUMBER",
"status": "Completed",
"occurrenceDateTime": "2021-04-01T04:00:00+00:00",
"location": {
"reference": "resource:0",
"display": "VACCINATION-SITE"
},
"protocolApplied": {
"doseNumber": 1,
"targetDisease": {
"coding": [
{
"system": "http://browser.ihtsdotools.org/?perspective=full& conceptId1=840536004",
"code": "840536004"
}
]
}
},
"note": [
{
"text": "PB COVID-19"
}
]
}
}
2023-05-31 12:45:29 -06:00
```