PHPackages                             rossriley/postcodelib - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. rossriley/postcodelib

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

rossriley/postcodelib
=====================

Perform simple analysis and validation on UK postcodes

1.0(10y ago)024MITPHP

Since Jan 22Pushed 10y ago1 watchersCompare

[ Source](https://github.com/rossriley/postcodelib)[ Packagist](https://packagist.org/packages/rossriley/postcodelib)[ RSS](/packages/rossriley-postcodelib/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (2)Used By (0)

A Value Object for UK Postcodes
-------------------------------

[](#a-value-object-for-uk-postcodes)

This simple class ensure that a postcode is valid along with some helper methods to ease formatting.

### Usage

[](#usage)

```
use Postcodelib\Postcode;

$postcode = new Postcode('B55SE');
$postcode->valid(); // returns true
$postcode->postcode(); // returns a normalised string: B5 5SE
$postcode->prefix(); // returns B5
$postcode->suffix(); // returns 5SE

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3812d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5082?v=4)[Ross Riley](/maintainers/rossriley)[@rossriley](https://github.com/rossriley)

---

Top Contributors

[![rossriley](https://avatars.githubusercontent.com/u/5082?v=4)](https://github.com/rossriley "rossriley (2 commits)")

### Embed Badge

![Health badge](/badges/rossriley-postcodelib/health.svg)

```
[![Health](https://phpackages.com/badges/rossriley-postcodelib/health.svg)](https://phpackages.com/packages/rossriley-postcodelib)
```

###  Alternatives

[chaoswey/taiwan-id-validator

台灣身分證、統一編號驗證

319.9k](/packages/chaoswey-taiwan-id-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
