{"id":24919775,"url":"https://github.com/steinfletcher/paf-address-format","last_synced_at":"2025-04-09T18:08:45.456Z","repository":{"id":48124613,"uuid":"67962558","full_name":"steinfletcher/paf-address-format","owner":"steinfletcher","description":"Java utility to format PAF UK delivery points for print ","archived":false,"fork":false,"pushed_at":"2020-01-11T16:41:18.000Z","size":41,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T20:04:40.953Z","etag":null,"topics":["addresses","formatting","paf","uk"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steinfletcher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-12T00:37:06.000Z","updated_at":"2022-07-21T22:52:40.000Z","dependencies_parsed_at":"2022-08-12T19:10:13.349Z","dependency_job_id":null,"html_url":"https://github.com/steinfletcher/paf-address-format","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinfletcher%2Fpaf-address-format","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinfletcher%2Fpaf-address-format/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinfletcher%2Fpaf-address-format/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinfletcher%2Fpaf-address-format/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steinfletcher","download_url":"https://codeload.github.com/steinfletcher/paf-address-format/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248084375,"owners_count":21045125,"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":["addresses","formatting","paf","uk"],"created_at":"2025-02-02T10:37:28.348Z","updated_at":"2025-04-09T18:08:45.434Z","avatar_url":"https://github.com/steinfletcher.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"paf-address-format\n===\n\n[![CircleCI](https://circleci.com/gh/steinfletcher/paf-address-format.svg?style=shield\u0026circle-token=bd07a471e0058fe5d3334d035939573e00dfcc47)](https://circleci.com/gh/steinfletcher/paf-address-format)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.steinf/paf-address-format/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.steinf/paf-address-format)\n[![Coverage Status](https://coveralls.io/repos/github/steinfletcher/paf-address-format/badge.svg)](https://coveralls.io/github/steinfletcher/paf-address-format)\n\n\nA simple library (with no dependencies) that formats a PAF address for print.\n\nAttempts to comply with the Royal Mail's [PAF Programmer's guide](http://www.royalmail.com/sites/default/files/docs/pdf/programmers_guide_edition_7_v5.pdf)\n\n## Why?\n\nThere are 7 rules which determine the print format of an address and several exceptions can be applied to these rules.\n Writing some code to format an address is not a trivial task.  Given an address, this library determines the rule type, \n analyzes which exceptions should be applied and invokes a specific formatter for the address.\n\n## Release\n\nTo add the dependency using Maven, use the following:\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.steinf\u003c/groupId\u003e\n    \u003cartifactId\u003epaf-address-format\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nTo add a dependency using Gradle:\n\n```\ndependencies {\n  compile 'com.steinf:paf-address-format:0.0.2'\n}\n```\n\n## Usage\n\n### Extract the lines of the print address\n\n```java\nDeliveryPoint deliveryPoint = new DeliveryPoint.Builder()\n  .withSubBuildingName(\"A\")\n  .withBuildingNumber(\"12\")\n  .withThroughfare(\"HIGH STREET NORTH\")\n  .withDependentLocality(\"COOMBE BISSETT\")\n  .withPostTown(\"SALISBURY\")\n  .withPostcode(\"SP5 4NA\")\n  .build();\n\nList\u003cString\u003e parts = deliveryPoint.formattedParts();\n\nassertThat(parts.get(0)).isEqualTo(\"12A HIGH STREET NORTH\");\nassertThat(parts.get(1)).isEqualTo(\"COOMBE BISSETT\");\nassertThat(parts.get(2)).isEqualTo(\"SALISBURY\");\nassertThat(parts.get(3)).isEqualTo(\"SP5 4NA\");\n```\n\n### Get the entire address as a string\n\n```java\nDeliveryPoint deliveryPoint = new DeliveryPoint.Builder()\n  .withSubBuildingName(\"2B\")\n  .withBuildingName(\"THE TOWER\")\n  .withBuildingNumber(\"27\")\n  .withThroughfare(\"JOHN STREET\")\n  .withPostTown(\"WINCHESTER\")\n  .withPostcode(\"SO23 9AP\")\n  .build();\n\nString formatted = deliveryPoint.toString();\n\nassertThat(formatted).isEqualTo(\n    \"2B THE TOWER\\n\" +\n    \"27 JOHN STREET\\n\" +\n    \"WINCHESTER\\n\" +\n    \"SO23 9AP\"\n);\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteinfletcher%2Fpaf-address-format","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteinfletcher%2Fpaf-address-format","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteinfletcher%2Fpaf-address-format/lists"}