PHPackages                             generoi/finnish-postal-codes - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. generoi/finnish-postal-codes

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

generoi/finnish-postal-codes
============================

Finnish postal codes

v1.20260328(1mo ago)0214↑50%MITPHPPHP &gt;=8.1CI passing

Since Dec 16Pushed 1mo agoCompare

[ Source](https://github.com/generoi/finnish-postal-codes)[ Packagist](https://packagist.org/packages/generoi/finnish-postal-codes)[ Docs](https://github.com/generoi/finnish-postal-codes)[ RSS](/packages/generoi-finnish-postal-codes/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (89)Used By (0)

Finnish Postal Codes
====================

[](#finnish-postal-codes)

A Composer package containing all Finnish postal codes and city names in Finnish, Swedish, and English. Data is sourced from [posti.fi](https://www.posti.fi).

Installation
------------

[](#installation)

```
composer require generoi/finnish-postal-codes
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use FinnishPostalCodes\PostalCodes;
use FinnishPostalCodes\Language;

// Create instance with language
$sv = PostalCodes::sv();
$city = $sv->getCity('00900'); // Returns "HELSINGFORS"

$fi = PostalCodes::fi();
$city = $fi->getCity('00900'); // Returns "HELSINKI"

// Get full record
$record = $fi->getRecord('00900');
echo $record->postcode_fi_name; // "HELSINKI"
echo $record->municipal_name_fi; // "Helsinki"
echo $record->ad_area_fi; // "Helsinki-Uusimaa"

// Check if postal code exists
if ($fi->exists('00900')) {
    // ...
}

// Get all postal codes
$allPostcodes = $fi->getAllPostcodes();

// Iterate over all records (memory efficient)
foreach ($fi->getFull() as $postcode => $record) {
    // Process each record
}
```

### Direct File Access

[](#direct-file-access)

If you need raw arrays, you can require the PHP files directly:

```
$fiData = require 'vendor/generoi/finnish-postal-codes/data/php/postcodes-fi.php';
```

Data Update
-----------

[](#data-update)

To update the postal code data, run:

```
composer run fetch
```

Or directly:

```
php scripts/fetch.php
```

Exit codes:

- `0` - Success/Updated
- `1` - Error
- `2` - No change (already up to date)

Data Files
----------

[](#data-files)

The package includes data in multiple formats:

- **JSON**: `data/json/postcodes-{fi|sv|en|full}.json`
- **PHP**: `data/php/postcodes-{fi|sv|en|full}.php` (can be required directly)

License
-------

[](#license)

MIT

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance98

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.7% 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

Every ~1 days

Total

88

Last Release

41d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/302736?v=4)[oxyc](/maintainers/oxyc)[@oxyc](https://github.com/oxyc)

---

Top Contributors

[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (88 commits)")[![oxyc](https://avatars.githubusercontent.com/u/302736?v=4)](https://github.com/oxyc "oxyc (3 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/generoi-finnish-postal-codes/health.svg)

```
[![Health](https://phpackages.com/badges/generoi-finnish-postal-codes/health.svg)](https://phpackages.com/packages/generoi-finnish-postal-codes)
```

###  Alternatives

[spiral/mcp-server

Spiral bridge for MCP server

541.1k2](/packages/spiral-mcp-server)

PHPackages © 2026

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