{"id":48535565,"url":"https://github.com/italia/dcc-utils","last_synced_at":"2026-04-08T01:31:52.205Z","repository":{"id":45282343,"uuid":"438036917","full_name":"italia/dcc-utils","owner":"italia","description":"Python library to decode the EU Covid-19 vaccine certificate","archived":false,"fork":false,"pushed_at":"2022-02-28T10:10:31.000Z","size":118,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T17:11:09.390Z","etag":null,"topics":["covid-19","dcc","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/italia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-13T21:56:56.000Z","updated_at":"2024-11-11T19:43:59.000Z","dependencies_parsed_at":"2022-09-22T19:21:32.747Z","dependency_job_id":null,"html_url":"https://github.com/italia/dcc-utils","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/italia/dcc-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italia%2Fdcc-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italia%2Fdcc-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italia%2Fdcc-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italia%2Fdcc-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/italia","download_url":"https://codeload.github.com/italia/dcc-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/italia%2Fdcc-utils/sbom","scorecard":{"id":496664,"data":{"date":"2025-08-11","repo":{"name":"github.com/italia/dcc-utils","commit":"fe7529203c8dab193006045e8e2eabd5c87d130f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/italia/dcc-utils/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/italia/dcc-utils/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/italia/dcc-utils/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pc-update.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/italia/dcc-utils/pc-update.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pc-update.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/italia/dcc-utils/pc-update.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pc-update.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/italia/dcc-utils/pc-update.yml/master?enable=pin","Warn: pipCommand not pinned by hash: publish.sh:4","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:29","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/pc-update.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: GHSA-3f63-hfp8-52jq","Warn: Project is vulnerable to: GHSA-44wm-f244-xhp3","Warn: Project is vulnerable to: GHSA-4fx9-vc88-q2xc","Warn: Project is vulnerable to: PYSEC-2023-227 / GHSA-8ghj-p4vj-mr35","Warn: Project is vulnerable to: PYSEC-2022-10 / GHSA-8vj2-vxx3-667w","Warn: Project is vulnerable to: PYSEC-2021-317 / GHSA-98vv-pw6r-q6q4","Warn: Project is vulnerable to: PYSEC-2022-168 / GHSA-9j59-75qj-795w","Warn: Project is vulnerable to: GHSA-j7hp-h8jx-5ppr","Warn: Project is vulnerable to: PYSEC-2022-42979 / GHSA-m2vv-5vj5-2hm7","Warn: Project is vulnerable to: PYSEC-2022-8 / GHSA-pw3c-h7wp-cvhx","Warn: Project is vulnerable to: PYSEC-2022-9 / GHSA-xrcv-f9gm-v42c","Warn: Project is vulnerable to: PYSEC-2023-175"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T20:34:58.731Z","repository_id":45282343,"created_at":"2025-08-19T20:34:58.731Z","updated_at":"2025-08-19T20:34:58.731Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31536451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["covid-19","dcc","python"],"created_at":"2026-04-08T01:31:51.537Z","updated_at":"2026-04-08T01:31:52.196Z","avatar_url":"https://github.com/italia.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DCC Utils\nPython library to decode the EU Covid-19 vaccine certificate, as [specified by the EU](https://ec.europa.eu/health/ehealth/covid-19_en).\n\n[![Latest Version](https://img.shields.io/pypi/v/dcc-utils.svg)](https://pypi.python.org/pypi/dcc-utils/)\n[![CI](https://github.com/italia/dcc-utils/actions/workflows/ci.yml/badge.svg)](https://github.com/astagi/dcc-utils)\n[![Coverage](https://codecov.io/gh/italia/dcc-utils/branch/master/graph/badge.svg?token=SZ7lyP073V)](https://codecov.io/gh/astagi/dcc-utils)\n[![Supported Python versions](https://img.shields.io/badge/python-3.7%2C%203.8%2C%203.9%2C%203.10-blue.svg)](https://pypi.python.org/pypi/dcc-utils/)\n[![License](https://img.shields.io/github/license/italia/dcc-utils.svg)](https://pypi.python.org/pypi/dcc-utils/)\n[![Downloads](https://img.shields.io/pypi/dm/dcc-utils.svg)](https://pypi.python.org/pypi/dcc-utils/)\n\n\n## Setup\n\n```sh\npip install dcc-utils\n```\n\nMake sure `zbar` is installed in your system\n  * For Mac OS X, it can be installed via `brew install zbar`\n  * Debian systems via `apt install libzbar0`. [Source](https://pypi.org/project/pyzbar/)\n  * Fedora / Red Hat `dnf install zbar`\n\n## Usage\n\n### Parse DCC\n\nThis library takes an image with a QR code or a raw repr. of a vaccine certificate as\nthe parameter and will show the certificate's content. \n\n```py\nfrom dcc_utils import dcc\n\ndcc_from_img = dcc.from_image(\"/my/certificate/path\")\ndcc_from_raw = dcc.from_raw(\"HC1:6BF...FTPQ3C3F\")\n```\n\nThen you can access to `payload` and `kid`\n\n```py\nassert dcc_from_img.kid == \"53FOjX/4aJs=\"\nassert dcc_from_img.payload[\"v\"][0][\"ci\"] == \"URN:UVCI:01:FR:W7V2BE46QSBJ#L\"\n```\n\n👉🏻 `payload` follows [EU Digital COVID Certificates JSON Schema Specification](https://ec.europa.eu/health/sites/default/files/ehealth/docs/covid-certificate_json_specification_en.pdf)\n\n`from_image` and `from_raw` methods may rise `DCCParsingError`\n\n```py\nfrom dcc_utils.exceptions import DCCParsingError\n```\n\n### Validate DCC digital signature\n\n```py\nsignature = b\"\"\"\n-----BEGIN CERTIFICATE-----\nMIIIAjCCBeqgAwIBAgIQAnq8g/T\n-----END CERTIFICATE-----\n\"\"\"\nassert my_dcc.check_signature(signature)\n```\n\n`check_signature` method may rise `DCCSignatureError`\n\n```py\nfrom dcc_utils.exceptions import DCCSignatureError\n```\n\n### Evaluate CertLogic business rules\n\nWith dcc-utils you can evaluate [business rules](https://github.com/ehn-dcc-development/dgc-business-rules) against a DCC\n\n```py\nfrom dcc_utils import rule, dcc\n\nmy_dcc = dcc.from_image(\"/my/certificate/path\")\nmy_rule = rule.from_file(\"/my/rule.json\")\nprint(my_rule.description[\"en\"])\nmy_rule.evaluate_dcc(my_dcc) # True or False\n```\n\n`evaluate_dcc` accepts extra variables as a second parameter, e.g. `validationClock`\n\n```py\nimport datetime\nclock = datetime.datetime(2022, 10, 10, 0, 0, tzinfo=datetime.timezone.utc)\nmy_rule.evaluate_dcc(\n    my_dcc,\n    {\n        \"validationClock\": clock,\n    },\n)\n```\n\nyou can also load rules from JSON (`from_json`), useful to evaluate rules \nexposed on a server\n\n```py\nmy_rule = rule.from_json({...})\n```\n\n`from_file` and `from_json` method may rise `DCCRuleError`\n\n```py\nfrom dcc_utils.exceptions import DCCRuleError\n```\n\n## Dev setup\n\nInstall dependencies using pip:\n\n```\npip install -r requirements-dev.txt\n```\n\nRun tests\n\n```\nmake test\n``` \n\n## EU Digital COVID Certificate Specifications\nWhat's in a EU Digital COVID/Green Certificate?\n* Value Sets for Digital Green Certificates https://ec.europa.eu/health/sites/default/files/ehealth/docs/digital-green-certificates_dt-specifications_en.pdf\n* JSON schema: https://github.com/ehn-dcc-development/ehn-dcc-schema\n\n### Sample data\nDigital Green Certificate Gateway (DGCG) samples for all participating countries:\nhttps://github.com/eu-digital-green-certificates/dgc-testdata\n\n## Credits\nParts of this code are adapted from [vacdec project](https://github.com/HQJaTu/vacdec).\n\n## License\nThis library is available under the [MIT](https://opensource.org/licenses/mit-license.php) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitalia%2Fdcc-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitalia%2Fdcc-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitalia%2Fdcc-utils/lists"}