{"id":42901269,"url":"https://github.com/codice/countrycode","last_synced_at":"2026-01-30T15:34:40.240Z","repository":{"id":28486912,"uuid":"118529838","full_name":"codice/countrycode","owner":"codice","description":"Initial Country Code converter","archived":false,"fork":false,"pushed_at":"2026-01-16T15:23:11.000Z","size":279,"stargazers_count":4,"open_issues_count":5,"forks_count":7,"subscribers_count":32,"default_branch":"master","last_synced_at":"2026-01-17T04:54:01.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-01-22T23:35:39.000Z","updated_at":"2026-01-16T15:23:11.000Z","dependencies_parsed_at":"2025-08-13T19:13:29.042Z","dependency_job_id":"ce48d68f-38a3-4579-a448-39434d06c6bb","html_url":"https://github.com/codice/countrycode","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/codice/countrycode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codice%2Fcountrycode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codice%2Fcountrycode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codice%2Fcountrycode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codice%2Fcountrycode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codice","download_url":"https://codeload.github.com/codice/countrycode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codice%2Fcountrycode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: 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":[],"created_at":"2026-01-30T15:34:39.471Z","updated_at":"2026-01-30T15:34:40.231Z","avatar_url":"https://github.com/codice.png","language":"Java","readme":"[![Build Status](https://travis-ci.org/codice/countrycode.svg?branch=master)](https://travis-ci.org/codice/countrycode)\n\n# Country Code Library\n\nThe Country Code library provides facilities for converting between different country code standards.\nThis software is currently in a Beta form and is subject to change\n\n## Usage\n\nAdd the Codice Repository to your build\n```\n        \u003crepository\u003e\n            \u003cid\u003ecodice\u003c/id\u003e\n            \u003cname\u003eCodice Repository\u003c/name\u003e\n            \u003curl\u003ehttps://artifacts.codice.org/content/groups/public/\u003c/url\u003e\n        \u003c/repository\u003e\n```\n\nAdd the Converter Dependency\n\n```\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.codice.countrycode\u003c/groupId\u003e\n            \u003cartifactId\u003econverter\u003c/artifactId\u003e\n            \u003cversion\u003e${countryconverter.version}\u003c/version\u003e\n        \u003c/dependency\u003e\n```\n\nHappy Converting!\n\n## CountryCodeSimple\n\nSimple interface for the typical use case of converting between the following standards: ISO 3166-1, \nGENC 3.0.0, and FIPS 10-4, GEC Update 18.\n \n```   \nString countryCode = CountryCodeSimple.convert(\"CH\", FIPS_10_4_ALPHA2, ISO_3166_1_ALPHA3)\nassert countryCode.equals(\"CHN\");\n```   \n\n## Supported Standards\nStandards are available in various formats. For example, the ISO 3166-1 `alpha2` format for the country\nAfghanistan is `AF`, while its `alpha3` and `numeric` formats are `AFG` and `004`, respectively.\n\nThere are 4 currently supported standards and their respective available formats (the `name` and `version`\nin parenthesis, respectively, can be used to lookup the standard in the default `StandardRegistry`):\n* FIPS 10-4 (`FIPS`, `10-4`)\n  - alpha2\n* GEC 18 (`GEC`, `18`)\n  - alpha2\n* ISO 3166-1 (`ISO3166`, `1`)\n  - alpha2\n  - alpha3\n  - numeric\n* GENC 3.0.0 (`GENC`, `3.0.0`)\n  - alpha2\n  - alpha3\n  - numeric\n  \nA country code can be retrieved for a given format with the following:\n\n    CountryCode countryCode = new CountryCode();\n    String alpha2Format = countryCode.getAsFormat(\"alpha2\"); // ex, \"AF\"\n\n\n## Low-level Interfaces\n\u003cdetails\u003e\n  \u003csummary\u003e\n    Converter\n  \u003c/summary\u003e\n  The converter is used to convert between country code standards. Standards can be retrieved via the `StandardRegistry`.\n      \n  ```    \n    Converter converter = new CountryCodeConverter();\n    \n    StandardRegistry registry = StandardRegistryImpl.getInstance();\n    StandardProvider fipsStandard = registry.lookup(\"FIPS\", \"10-4\");\n    StandardProvider isoStandard = registry.lookup(\"ISO3166\", \"1\");\n    \n    // converting from FIPS 10-4 to ISO 3166-1 with alpha2\n    Set\u003cCountryCode\u003e convertedCountryCodes = converter.fromAlpha2(\"AF\", fipsStandard.getStandard(), isoStandard.getStandard());\n    \n    // converting from FIPS 10-4 to ISO 3166-1 with alpha3\n    Set\u003cCountryCode\u003e convertedCountryCodes = converter.fromAlpha3(\"AFG\", fipsStandard.getStandard(), isoStandard.getStandard());\n    \n    // converting from FIPS 10-4 to ISO 3166-1 with numeric\n    Set\u003cCountryCode\u003e convertedCountryCodes = converter.fromNumeric(\"004\", fipsStandard.getStandard(), isoStandard.getStandard());\n  \n  ```\n\u003c/details\u003e\n\u003cdetails\u003e\n  \u003csummary\u003e\n    StandardProvider\n  \u003c/summary\u003e\n  \n  ```\n    StandardRegistry registry = StandardRegistryImpl.getInstance();\n    StandardProvider isoStandard = registry.lookup(\"ISO3166\", \"1\");\n  \n    // converting from ISO 3166-1 alpha2 to ISO 3166-1 alpha3\n    Optional\u003cCountryCode\u003e optionalCountryCode =\n            isoStandard\n                .getStandardEntries()\n                .stream()\n                .filter(c -\u003e c.getAsFormat(\"alpha2\").equals(\"AT\"))\n                .findFirst();\n  \n    if (optionalCountryCode.isPresent())\n      System.out.println(optionalCountryCode.get().getAsFormat(\"alpha3\"));\n  \n  ```\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodice%2Fcountrycode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodice%2Fcountrycode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodice%2Fcountrycode/lists"}