PHPackages                             mlocati/comuni-italiani - 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. mlocati/comuni-italiani

ActiveLibrary

mlocati/comuni-italiani
=======================

List of Italian Regioni (Regions), Province (Provinces), and Comuni (Municipalities) with data from Istat

1.3.3(11mo ago)33.9k↓47.4%[1 PRs](https://github.com/mlocati/comuni-italiani/pulls)MITPHPPHP &gt;=7.4CI failing

Since Jul 1Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/mlocati/comuni-italiani)[ Packagist](https://packagist.org/packages/mlocati/comuni-italiani)[ Docs](https://github.com/mlocati/comuni-italiani)[ GitHub Sponsors](https://github.com/sponsors/mlocati)[ Fund](https://paypal.me/mlocati)[ RSS](/packages/mlocati-comuni-italiani/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (9)Used By (0)

[![Tests](https://github.com/mlocati/comuni-italiani/actions/workflows/tests.yml/badge.svg)](https://github.com/mlocati/comuni-italiani/actions/workflows/tests.yml)[![Coverage](https://camo.githubusercontent.com/c6eda0a639bbe46c2cefeec2d9392bc6c71f2efbc91f6ef07696d197b86a736d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d6c6f636174692f636f6d756e692d6974616c69616e692f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/mlocati/comuni-italiani?branch=main)

Comuni Italiani
---------------

[](#comuni-italiani)

This PHP library contains the whole list of Italian Regions (regioni), Provinces (province/UTS), and Municipalities (comuni).

The data comes from the official [Situas](https://situas.istat.it) service of the Istituto nazionale di statistica (Istat), that publishes its data with the [CC-BY-4.0 license](https://creativecommons.org/licenses/by/4.0/) .

### Installation

[](#installation)

You can install this package with [Composer](https://getcomposer.org/):

```
composer require mlocati/comuni-italiani
```

### Data Structure

[](#data-structure)

This library provides the following Italian Administrative divisions:

- **Geographical Subdivisions** (*ripartizioni geografiche*) For example "Nord-ovest", "Centro", "Sud"
- **Regions** (*regioni*) For example "Piemonte", "Lazio", "Campania"
- **Provinces** (*province*) and **Supra-Municipal Territorial Units** (**UTS** - *unità territoriale sovracomunale*)
- **Municipalities** (*comuni*)

Where:

- every Geographical Subdivision contains one or more Regions
- every Region contains one or more Provinces/UTS
- every Province/UTS contains one or more Municipalities

### Data Available

[](#data-available)

This library provides the following data:

- for the **Geographical Subdivisions**
    - the Istat ID (example: `1`)
    - the name (example: `'Nord-ovest'`)
    - the first level of the current Nomenclature of Territorial Units for Statistics (NUTS1) (example: `'ITC'`)
    - the list of Regions
- for the **Regions**
    - the parent Geographical Subdivision
    - the Istat ID (example: `'01'`)
    - the name (example: `'Piemonte'`)
    - the type:
        - Ordinary Status (*regione a statuto ordinario*)
        - Special Status (*regione a statuto speciale*)
    - the Fiscal Code (*codice fiscale*) assigned by the Agenzia delle Entrate (example: `'80087670016'`)
    - the second level of the current Nomenclature of Territorial Units for Statistics (NUTS2) (example: `'ITC1'`)
    - the Capital Municipality of this Region (*capoluogo di regione*) (example: `'Torino'`)
    - the list of Provinces/UTS
- for the **Provinces** / **UTS**
    - the parent Region
    - the Istat ID (example: `'201'`)
    - the name (example: `'Torino'`)
    - the historical Province code (example: `'001'`)
    - the type:
        - Province (*provincia*)
        - Autonomous Province (*provincia autonoma*)
        - Metropolitan City (*città metropolitana*)
        - Free Consortium of Municipalities (*libero consorzio di comuni*)
        - Non-Administrative Unit (*unità non amministrativa*) - former Provinces of Friuli-Venezia Giulia
    - the vehicle code (*sigla automobilistica*) (example: `'TO'`)
    - the Fiscal Code (*codice fiscale*) assigned by the Agenzia delle Entrate (example: `'01907990012'`)
    - the third level of the current Nomenclature of Territorial Units for Statistics (NUTS3) (example: `'ITC11'`)
    - the Capital Municipalities of this Province/UTS (*capoluogo di provincia*) (example: `'Torino'`)
    - the list of Municipalities
- for the **Municipalities**
    - the parent Province/UTS
    - the Istat ID (example: `'001272'`)
    - the name (example: `'Torino'`)
    - the Italian and Foreign names for bilingual municipalities (for example: `'Bolzano'` and `'Bozen'`)
    - if the Municipality is the Capital Municipality of its Region (*capoluogo di regione*)
    - if the Municipalities is a Capital Municipalities of its Province/UTS (*capoluogo di provincia*)
    - the Cadastral Code (*codice catastale*) (example: `'L219'`)
    - the Fiscal Code (*codice fiscale*) assigned by the Agenzia delle Entrate (example: `'00514490010'`)
    - the first level of the current Nomenclature of Territorial Units for Statistics (NUTS1) (example: `'ITC'`)
    - the second level of the current Nomenclature of Territorial Units for Statistics (NUTS2) (example: `'ITC1'`)
    - the third level of the current Nomenclature of Territorial Units for Statistics (NUTS3) (example: `'ITC11'`)

### Retrieving All Territories

[](#retrieving-all-territories)

You can have a list of all the Geographical Subdivisions, Regions, Provinces/UTS, and Municipalities using the `Factory` class.

For example:

```
use MLocati\ComuniItaliani\Factory;

$factory = new Factory();

$allGeographicalSubdivisions = $factory->getGeographicalSubdivisions();
$allRegions = $factory->getRegions();
$allProvinces = $factory->getProvinces();
$allMunicipalities = $factory->getMunicipalities();
```

### Finding Territories by ID

[](#finding-territories-by-id)

If you want to retrieve a territory given its ID, you can use the `Finder` class:

```
use MLocati\ComuniItaliani\Finder;

$finder = new Finder();

$geographicalSubdivision = $finder->getGeographicalSubdivisionByID(1);
$region = $finder->getRegionByID('01');
$province = $finder->getProvinceByID('201');
$municipality = $finder->getMunicipalityByID('001272');
```

### Finding Provinces by Vehicle Code

[](#finding-provinces-by-vehicle-code)

You can use the `getProvinceByVehicleCode` method of the `Finder` class:

```
use MLocati\ComuniItaliani\Finder;

$finder = new Finder();

echo $finder->getProvinceByVehicleCode('CO')->getName();
// prints Como
```

### Finding Territories by Name

[](#finding-territories-by-name)

You can use the `Finder` class to find Geographical Subdivisions, Regions, Provinces/UTS, and Municipalities by name.

The text to be searched will be split into words, and you'll get the territories whose names contain all the words.

For example, searching for `roma lombard` will return the `Romano di Lombardia (BG)` municipality.

Examples:

```
use MLocati\ComuniItaliani\Finder;

$finder = new Finder();

$geographicalSubdivisions = $finder->findGeographicalSubdivisionsByName('Nord');
$regions = $finder->findRegionsByName('Campa');
$provinces = $finder->findProvincesByName('Bozen');
$municipalities = $finder->findMunicipalitiesByName('Roma lombard');
```

By default, Finder will look for the beginning of words. So, `ampania` won't match `Campania`.

If you want to allow searching in the middle of the words, specify `true` as the second parameter:

```
use MLocati\ComuniItaliani\Finder;

$finder = new Finder();

$geographicalSubdivisions = $finder->findGeographicalSubdivisionsByName('ord', true);
$regions = $finder->findRegionsByName('ampania', true);
$provinces = $finder->findProvincesByName('ozen', true);
$municipalities = $finder->findMunicipalitiesByName('oma ombard', true);
```

You can also restrict the search to specific territories:

```
use MLocati\ComuniItaliani\Finder;

$finder = new Finder();

$province = $finder->getProvinceByVehicleCode('BG');
$municipalities = $finder->findMunicipalitiesByName('romano', false, $province);
// The same applies to findRegionsByName and findProvincesByName
```

### Testing Hierarchy

[](#testing-hierarchy)

Given two territories, you can check if they are the same by using the `isSame()` method:

```
if ($territory1->isSame($territory2)) {
    echo 'Same territory';
}
```

You can also check if a territory is contained in another territory:

```
if ($territory1->isContainedIn($territory2)) {
    echo "{$territory1} is contained in {$territory2}";
}
if ($territory1->isSameOrContainedIn($territory2)) {
    echo "{$territory1} is contained in {$territory2} (or they are the same)";
}
```

For Geographical Subdivisions, Regions, and Provinces/UTS (which are containers of other territories) you can also use the `contains()` and `isSameOrContains()` methods.

```
// $region is an instance of Region here
if ($region->contains($territory)) {
    echo "{$region} contains {$terrtory}";
}

if ($region->isSameOrContains($territory)) {
    echo "{$region} is same (or contains) {$terrtory}";
}
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance55

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88% 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 ~59 days

Recently: every ~89 days

Total

7

Last Release

330d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e9d7ece045fc89575e083ee4852edf31218df403c84f41a0de01863dae982f5?d=identicon)[mlocati](/maintainers/mlocati)

---

Top Contributors

[![mlocati](https://avatars.githubusercontent.com/u/928116?v=4)](https://github.com/mlocati "mlocati (22 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

comuniistatitalianitalianiitalymunicipalitiesprovinceprovincesregioniregionsregionprovinceitalianitalyregionsprovincesmunicipalitiesistatcountyprovinciacomunimunicipalityitaliacountiesregionicomunecittaitalianiitalianeregionenutssituas

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mlocati-comuni-italiani/health.svg)

```
[![Health](https://phpackages.com/badges/mlocati-comuni-italiani/health.svg)](https://phpackages.com/packages/mlocati-comuni-italiani)
```

###  Alternatives

[davidepastore/codice-fiscale

An italian tax code calculator and checker

104815.0k6](/packages/davidepastore-codice-fiscale)[azishapidin/indoregion

Package containing region of Indonesia (provinces, regencies, districts, and villages) for Laravel

27274.9k](/packages/azishapidin-indoregion)[salibhdr/typhoon-iran-cities

A laravel package for importing all regions such as provinces, counties, cities, city districts, rural districts and villages of iran into database accurately

6121.0k](/packages/salibhdr-typhoon-iran-cities)[woenel/prpcmblmts

Philippines region, province, cities/municipalities and barangays Laravel migration and table seeder.

2818.3k](/packages/woenel-prpcmblmts)[php-cuong/magento2-regions-manager

Manage regions in magento2 addresses

3520.2k](/packages/php-cuong-magento2-regions-manager)[adlino/locations

Iran Provinces, Counties and Cities with a Google Map Location for Laravel.

171.3k](/packages/adlino-locations)

PHPackages © 2026

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