PHPackages                             devnix/belfiore-code - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. devnix/belfiore-code

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

devnix/belfiore-code
====================

Serialized data of Italian Belfiore codes and foreign region codes

0.3.2(7mo ago)627.3k↓30.6%2[2 issues](https://github.com/devnix/belfiore-code/issues)MITPHPPHP ^8.1CI passing

Since Feb 12Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/devnix/belfiore-code)[ Packagist](https://packagist.org/packages/devnix/belfiore-code)[ RSS](/packages/devnix-belfiore-code/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (11)Versions (10)Used By (0)

devnix/belfiore-code
====================

[](#devnixbelfiore-code)

[![Coverage Status](https://camo.githubusercontent.com/ac1d0160ea24456269c5fa32201a2b41e8eef19f677eb75494fcc359055d705b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6465766e69782f62656c66696f72652d636f64652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/devnix/belfiore-code?branch=master)

Official Italian Belfiore code list (cadastral code) which represents a [comune](https://en.wikipedia.org/wiki/Comune).

Update
------

[](#update)

To update the database, you have to clone the project and install the `dev-dependencies`. Then, the console will be available to download and dump the normalized datasets:

```
composer install
bin/console update

```

and you are golden.

Anyway, if you think that the crawled data is outdated, please [file an issue](https://github.com/devnix/belfiore-code/issues/new). I will update the new data ASAP.

Usage
=====

[](#usage)

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

[](#installation)

### PHP

[](#php)

```
composer require devnix/belfiore-code

```

Serialized data
---------------

[](#serialized-data)

You can get the up to date serialized database of comunes and foreign regions in CSV, JSON, XML and YAML inside the `dist/` folder in any language.

API
---

[](#api)

### PHP

[](#php-1)

There is a `Devnix\BelfioreCode\Collection\ComuneCollection` and a `Devnix\BelfioreCode\Collection\RegionCollection` to get an `ArrayCollection`filled with both databases. This enables you to directly iterate through them like an array, or even perform queries of columns.

#### Querying

[](#querying)

You can fetch a comune by its `registry_code` (also know as *cadastral code* or *belfiore code*).

```
