Package: verificac19
VerificaC19 Python SDK🐍 VerificaC19 SDK implementation for Python.RequirementsPython version >= 3.7MongoDB version >= 5.x (used to store CRL)Make surezbaris installed in your system.Source.For Mac OS X, it can be installed viabrew install zbarDebian systems viaapt install libzbar0Fedora / Red Hatdnf install zbarInstallpipinstallverificac19UsageDownload and cache rules, CRL data and DSCsYou can download and cache rules, CRL Data and DSCs usingservice.fromverificac19importserviceservice.update_all()update_allmay riseVerificaC19Errorfromverificac19.exceptionsimportVerificaC19Error⚠️ By default rules and DSCs will be cached in local folder,
to change it please setVC19_CACHE_FOLDERenv variable.⚠️ CRL data will be stored in a MongoDB database. By default the
connection string ismongodb://root:example@localhost:27017/VC19?authSource=admin,
if you want to change it, setVC19_MONGODB_URLenv variable.Verify a DCCYou can verify a DCC usingverifier. You can verify a DCC usingverify_imagefor images andverify_rawfor raw data.fromverificac19importverifierresult=verifier.verify_image("my_dcc.png")result=verifier.verify_raw("HC1:GH.....1GH")verify_imageandverify_rawreturn a dictionary containingpersonname,date_of_birth,codeand amessagealongside theresult{'code':verifier.Codes.NOT_VALID,'result':False,'message':'Certificate is not valid','person':'Sčasný Svätozár','date_of_birth':'1984-09-27'}you can compare the resultingcodewithverifier.CodesvaluesCodeDescriptionResult✅VALIDCertificate is validTrue⚠️TEST_NEEDEDTest needed if verification mode is BOOSTER_DGPFalse❌NOT_VALIDCertificate is not validFalse❌NOT_VALID_YETCertificate is not valid yetFalse❌REVOKEDCertificate is revokedFalse❌NOT_EU_DCCCertificate is not an EU DCCFalsefor exampleresult=verifier.verify_image("my_dcc.png")assertresult['code']==verifier.Codes.NOT_VALID⚠️verify_imageandverify_rawmay riseVerificaC19Errorin case you cache
is not initialized. You need to callservice.update_all()at least once!Verification modeIf you want to change verification mode and verify whether a certificate is a
Super Green Pass or not, you need to passverifier.Mode.SUPER_DGPtoverify_imageandverify_rawmethods.fromverificac19importverifierresult=verifier.verify_image("my_dcc.png",verifier.Mode.SUPER_DGP)verifier.Modeexposes 2 possible valuesCodeDescriptionNORMAL_DGPNormal verification (default value)SUPER_DGPSuper Green Pass verificationBOOSTER_DGPBooster verification modeDetailsSUPER_DGP Mode: VerificaC19 SDK considers a green certificate valid only for
people who have been vaccinated against or who have recovered from Covid19,
and will prevent all the others from
entering bars, restaurants, cinemas, gyms, theatres, discos and stadiums.BOOSTER_DGP Mode: VerificaC19 SDK considers green certificates generated after a
booster dose to be valid. Furthermore, green certificates generated after the
first vaccination cycle or recovery with the simultaneous presentation of a
digital document certifying the negative result of a SARS-CoV-2 test
are considered valid.DevelopmentInstall dev dependenciespip install -r requirements-dev.txtMake surezbaris installed in your system.Source.For Mac OS X, it can be installed viabrew install zbarDebian systems viaapt install libzbar0Fedora / Red Hatdnf install zbarCRL data will be stored in a MongoDB database. This repository provides a simpledocker-compose.ymlfile (dev instance) with a replica set. By default the
connection string ismongodb://root:example@localhost:27017/VC19?authSource=admin,
if you want to change it, setVC19_MONGODB_URLenv variable.Run testsmake testRun examplespython-mexamples.<example_name>AuthorsCopyright (c) 2022 -Lotrèk Digital AgencyContributorsThank you to everyone involved for improving this project, day by day.LicenseThis library is available under theMITlicense.