VOC001 - Invalid Country Code¶
Description¶
The country code provided is not a valid ISO 3166-1 alpha-2 code. Country codes are used to identify the origin of materials and manufacturing locations.
Severity¶
Warning
When This Occurs¶
originCountryinmaterialsProvenancecontains an invalid code- Country code is not in ISO 3166-1 alpha-2 format (2 uppercase letters)
Example¶
{
"credentialSubject": {
"materialsProvenance": [
{
"name": "Recycled Aluminum",
"originCountry": "USA" // Invalid: should be "US"
}
]
}
}
Valid Format¶
ISO 3166-1 alpha-2 codes are exactly 2 uppercase letters:
| Code | Country |
|---|---|
| US | United States |
| DE | Germany |
| CN | China |
| JP | Japan |
| FR | France |
Resolution¶
- Use correct ISO 3166-1 alpha-2 code:
- Verify country code:
from dppvalidator.vocabularies import get_bundled_country_codes
codes = get_bundled_country_codes()
print("US" in codes) # True