PHPackages                             cvilleger/geo-gouv - 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. cvilleger/geo-gouv

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

cvilleger/geo-gouv
==================

Simple Geo Gouv Library. Query geographic reference data.

0.3.0(3mo ago)13.5k—8.3%MITPHPPHP ^8.5CI passing

Since Sep 27Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/cvilleger/geo-gouv)[ Packagist](https://packagist.org/packages/cvilleger/geo-gouv)[ Docs](https://github.com/cvilleger/geo-gouv)[ RSS](/packages/cvilleger-geo-gouv/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (5)Versions (6)Used By (0)

[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/5e1327ba3acb286b1c6e4dffa08cc0bb83b763f1a2eddc2835aa772047bfa13d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6376696c6c656765722f67656f2d676f75762f63692e796d6c3f7374796c653d666f722d7468652d6261646765266272616e63683d6d61696e)](https://github.com/cvilleger/geo-gouv/actions/workflows/ci.yml)[![Packagist Version](https://camo.githubusercontent.com/e9528a46fee4423909fc9301073964fb80a8e7fdc34d16b894cc067a9646df2b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6376696c6c656765722f67656f2d676f75763f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/cvilleger/geo-gouv)[![Packagist Downloads](https://camo.githubusercontent.com/005e084680ec883f3b4e85f0764fcc46653a3d8193e04357eb02c4fa4481727d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6376696c6c656765722f67656f2d676f75763f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/cvilleger/geo-gouv)[![GitHub License](https://camo.githubusercontent.com/945687997cb553bbc2e4e4a95c2768458893a66fc7e8c81ba0870771858a8fdd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6376696c6c656765722f67656f2d676f75763f7374796c653d666f722d7468652d6261646765)](https://github.com/cvilleger/geo-gouv?tab=MIT-1-ov-file#readme)

cvilleger/geo-gouv
==================

[](#cvillegergeo-gouv)

About
-----

[](#about)

Query geographic reference data using offline data from 🇫🇷 [Gouv administrative division API](https://geo.api.gouv.fr/decoupage-administratif).

Features
--------

[](#features)

- Query all departments data
- Query all municipalities by department code

Requirements
------------

[](#requirements)

- PHP 8.5 or above

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

[](#installation)

Install this package as a dependency using [Composer](https://getcomposer.org).

```
  composer require cvilleger/geo-gouv
```

*Note that this package has **zero composer dependencies.***

Usage
-----

[](#usage)

### Retrieve departments

[](#retrieve-departments)

```
use Cvilleger\GeoGouv\Client;

print_r(new Client()->getDepartements()[0]);

/*
Cvilleger\GeoGouv\Model\Departement Object
(
    [nom] => Ain
    [code] => 01
    [codeRegion] => 84
    [coordinates] => 46.06551335, 5.28478031423462
    [region] => Cvilleger\GeoGouv\Model\Region Object
        (
            [nom] => Auvergne-Rhône-Alpes
            [code] => 84
        )

)
*/
```

### Retrieve municipalities by department code

[](#retrieve-municipalities-by-department-code)

```
use Cvilleger\GeoGouv\Client;

print_r(new Client()->getCommunesByDepartementCode('01')[0]);

/*
(
    [nom] => L'Abergement-Clémenciat
    [code] => 01001
    [codesPostaux] => Array
        (
            [0] => 01400
        )

    [coordinates] => Array
        (
            [0] => 4.9306
            [1] => 46.1517
        )

    [surface] => 1564.5
    [population] => 832
    [departement] => Cvilleger\GeoGouv\Model\CommuneDepartement Object
        (
            [nom] => Ain
            [code] => 01
        )

    [region] => Cvilleger\GeoGouv\Model\CommuneRegion Object
        (
            [nom] => Auvergne-Rhône-Alpes
            [code] => 84
        )
)
*/
```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance79

Regular maintenance activity

Popularity24

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~121 days

Total

5

Last Release

111d ago

PHP version history (3 changes)0.1.0PHP ^8.2

0.2.0PHP ^8.3

0.3.0PHP ^8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/54db682deddcee5a69f87c63313b69937efb6056e1f3bb55ebce5ef36dd29fd6?d=identicon)[cvilleger](/maintainers/cvilleger)

---

Top Contributors

[![cvilleger](https://avatars.githubusercontent.com/u/5745426?v=4)](https://github.com/cvilleger "cvilleger (28 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

geogouv

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cvilleger-geo-gouv/health.svg)

```
[![Health](https://phpackages.com/badges/cvilleger-geo-gouv/health.svg)](https://phpackages.com/packages/cvilleger-geo-gouv)
```

###  Alternatives

[mjaschen/phpgeo

Simple Yet Powerful Geo Library

1.6k8.6M22](/packages/mjaschen-phpgeo)[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[jmikola/geojson

GeoJSON implementation for PHP

3109.0M77](/packages/jmikola-geojson)[geokit/geokit

Geo-Toolkit for PHP

251924.7k6](/packages/geokit-geokit)[brick/geo

GIS geometry library

245862.1k15](/packages/brick-geo)[geo-io/interface

Geo I/O base interfaces.

626.1M7](/packages/geo-io-interface)

PHPackages © 2026

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