{"id":2059,"url":"https://github.com/FormatterKit/PostalCodeValidator","last_synced_at":"2025-07-31T12:33:19.868Z","repository":{"id":215156354,"uuid":"224426537","full_name":"FormatterKit/PostalCodeValidator","owner":"FormatterKit","description":"A validator for postal codes with support for 200+ regions","archived":true,"fork":false,"pushed_at":"2020-12-01T10:57:46.000Z","size":63,"stargazers_count":208,"open_issues_count":0,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-15T00:20:01.157Z","etag":null,"topics":["cldr","i18n","postalcode","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/FormatterKit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-11-27T12:31:36.000Z","updated_at":"2024-05-05T11:06:22.000Z","dependencies_parsed_at":"2024-01-04T20:31:23.031Z","dependency_job_id":null,"html_url":"https://github.com/FormatterKit/PostalCodeValidator","commit_stats":null,"previous_names":["formatterkit/postalcodevalidator"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormatterKit%2FPostalCodeValidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormatterKit%2FPostalCodeValidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormatterKit%2FPostalCodeValidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FormatterKit%2FPostalCodeValidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FormatterKit","download_url":"https://codeload.github.com/FormatterKit/PostalCodeValidator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228248407,"owners_count":17891447,"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":["cldr","i18n","postalcode","swift"],"created_at":"2024-01-05T20:16:02.442Z","updated_at":"2024-12-05T06:31:17.456Z","avatar_url":"https://github.com/FormatterKit.png","language":"Swift","funding_links":[],"categories":["Text","Swift"],"sub_categories":["Other Testing","Keychain"],"readme":"# PostalCodeValidator\n\n[![Build Status][ci status badge]][ci status]\n[![License][license badge]][license]\n[![Swift Version][swift version badge]][swift version]\n\nA validator for [postal codes](https://en.wikipedia.org/wiki/Postal_code)\nwith support for 200+ regions.\n\n```swift\nimport Foundation\nimport PostalCodeValidator\n\nif let validator = PostalCodeValidator(locale: .current) { // United States (US)\n    validator.validate(postalCode: \"95014\") // true\n    validator.validate(postalCode: \"22162-1010\") // true\n\n    validator.validate(postalCode: \"1234567\") // false\n    validator.validate(postalCode: \"INVALID\") // false\n}\n\n// 248 regions supported\nif let validator = PostalCodeValidator(regionCode: \"JP\") { // Japan (JP)\n    validator.validate(postalCode: \"154-0023\") // true\n    validator.validate(postalCode: \"12345\") // false\n}\n```\n\n\u003e **Note**: Only the region of a locale is used to determine validation rules.\n\u003e To validate the postal code for a particular region,\n\u003e you can construct a locale using an identifier with the `\"und\"` language code.\n\n## Requirements\n\n- Swift 4.0+\n\n## Installation\n\n### Swift Package Manager\n\nAdd the PostalCodeValidator package to your target dependencies in `Package.swift`:\n\n```swift\nimport PackageDescription\n\nlet package = Package(\n  name: \"YourProject\",\n  dependencies: [\n    .package(\n        url: \"https://github.com/FormatterKit/PostalCodeValidator\",\n        from: \"0.1.0\"\n    ),\n  ]\n)\n```\n\nThen run the `swift build` command to build your project.\n\n## Known Issues\n\n- Armed forces in Germany (and likely other countries)\n  use [special postal codes](https://de.wikipedia.org/wiki/Feldpost_%28Bundeswehr%29),\n  which aren't included in the upstream data source.\n  This will cause validation of these postal codes to fail.\n  _(Thanks for pointing this out, [@timohetzel](https://twitter.com/timohetzel))_\n\n## Additional Details\n\nThe CLDR previously maintained a list of postal code formats,\nbut that information was\n[deprecated in v27](http://unicode.org/reports/tr35/tr35-info.html#Postal_Code_Validation).\n\nFollowing the guidance of the\n[twitter-cldr-rb](https://github.com/twitter/twitter-cldr-rb/issues/166) project,\n`PostalCodeValidator` sources its information from http://i18napis.appspot.com.\nThe most recent release of this software uses\ninformation retrieved from the website on November 27, 2019.\n\n## License\n\nMIT\n\n## Contact\n\nMattt ([@mattt](https://twitter.com/mattt))\n\n[ci status]: https://github.com/FormatterKit/PostalCodeValidator/actions\n[ci status badge]: https://github.com/FormatterKit/PostalCodeValidator/workflows/CI/badge.svg\n[license]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[license badge]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat\n[swift version]: https://swift.org/download/\n[swift version badge]: http://img.shields.io/badge/swift%20version-4.0+-orange.svg?style=flat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFormatterKit%2FPostalCodeValidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFormatterKit%2FPostalCodeValidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFormatterKit%2FPostalCodeValidator/lists"}