{"id":19288117,"url":"https://github.com/fenixedu/postcodetools","last_synced_at":"2025-09-10T06:33:14.011Z","repository":{"id":56573872,"uuid":"146868970","full_name":"FenixEdu/PostCodeTools","owner":"FenixEdu","description":"Utilities for validating post codes","archived":false,"fork":false,"pushed_at":"2023-05-22T13:50:09.000Z","size":82,"stargazers_count":2,"open_issues_count":1,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-16T11:28:53.841Z","etag":null,"topics":["java-library","postcode-validation"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":false,"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/FenixEdu.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":"2018-08-31T09:11:13.000Z","updated_at":"2022-12-24T20:29:24.000Z","dependencies_parsed_at":"2022-08-15T21:10:44.642Z","dependency_job_id":null,"html_url":"https://github.com/FenixEdu/PostCodeTools","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FenixEdu%2FPostCodeTools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FenixEdu%2FPostCodeTools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FenixEdu%2FPostCodeTools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FenixEdu%2FPostCodeTools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FenixEdu","download_url":"https://codeload.github.com/FenixEdu/PostCodeTools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223888407,"owners_count":17220083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["java-library","postcode-validation"],"created_at":"2024-11-09T22:08:10.132Z","updated_at":"2024-11-09T22:08:10.781Z","avatar_url":"https://github.com/FenixEdu.png","language":"Java","readme":"# Post Code Tools\n\n\n## Overview\n\nThis library provides a simple Java API for validating a post code for any country.\n\n\n## Building\n\n```bash\nmvn install\n```\n\n## Using\n\nFirst, add the dependency to the SDK in your project, module or application.\nIf you use maven, add the following dependency, adjusting the version adequately:\n\n```xml\n   \u003cdependency\u003e\n      \u003cgroupId\u003eorg.fenixedu\u003c/groupId\u003e\n      \u003cartifactId\u003epostCodeTools\u003c/artifactId\u003e\n      \u003cversion\u003e${version.org.fenixedu.postCodeTools}\u003c/version\u003e\n   \u003c/dependency\u003e\n```\n\nThis artifact is available in the following maven repository:\n\n```xml\n    \u003crepositories\u003e\n        \u003crepository\u003e\n            \u003cid\u003efenixedu-maven-repository\u003c/id\u003e\n            \u003curl\u003ehttps://repo.fenixedu.org/fenixedu-maven-repository\u003c/url\u003e\n        \u003c/repository\u003e\n    \u003c/repositories\u003e\n```\n\nThe org.fenixedu.PostalCodeValidator provides a static method for validating post codes.\nThe method only validates the post code format, not weather the post code actually exists.\nThe first argument is the ISO 3166 Alfa-2 two letter country code.\n\n\n## Java API\n\nThe class org.fenixedu.PostalCodeValidator provides a Java API for validating post code \nformats. This class will also provides an example post code and a \"human readable\" expected \nformat for each country,\n\n```java\npublic static boolean isValidAreaCode(final String countryCode, final String postCode) { ... }\npublic static String examplePostCodeFor(final String countryCode) { ... }\npublic static String formatFor(final String countryCode) { ... }\n```\n\n\n## Examples\n\nIn the following invocation, the first call will return true, and the second call will return false:\n\n```java\norg.fenixedu.PostalCodeValidator.isValidAreaCode(\"PT\", \"1049-001\");\norg.fenixedu.PostalCodeValidator.isValidAreaCode(\"ES\", \"1049-001\");\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenixedu%2Fpostcodetools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffenixedu%2Fpostcodetools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffenixedu%2Fpostcodetools/lists"}