PHPackages                             siibnu/wilayah-indonesia-bps - 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. siibnu/wilayah-indonesia-bps

ActiveLibrary

siibnu/wilayah-indonesia-bps
============================

Data wilayah Indonesia (provinsi, kabupaten/kota, kecamatan, desa) berdasarkan SIG BPS

v1.0.1(yesterday)00MITPHPPHP ^8.2

Since Aug 1Pushed yesterdayCompare

[ Source](https://github.com/siibnu99/wilayah-indonesia-bps)[ Packagist](https://packagist.org/packages/siibnu/wilayah-indonesia-bps)[ Docs](https://github.com/siibnu99/wilayah-indonesia-bps)[ RSS](/packages/siibnu-wilayah-indonesia-bps/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (3)Used By (0)

Wilayah Indonesia BPS
=====================

[](#wilayah-indonesia-bps)

[![Packagist Version](https://camo.githubusercontent.com/e48c9c64849f87304e4e60c2ba10e744879675570a335ccd6f43d29a2b8a9077/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736969626e752f77696c617961682d696e646f6e657369612d6270732e737667)](https://packagist.org/packages/siibnu/wilayah-indonesia-bps)[![Packagist Downloads](https://camo.githubusercontent.com/fa87f34a1dd208b8bb4251789e8bb7f1c19f2aacf78dfa435e2f7135434e54b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736969626e752f77696c617961682d696e646f6e657369612d6270732e737667)](https://packagist.org/packages/siibnu/wilayah-indonesia-bps)[![PHP Version](https://camo.githubusercontent.com/5e6eaec05bc08c87f7e2e449bce5fe2988deda32be5ae96f086d17fac7090fa6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736969626e752f77696c617961682d696e646f6e657369612d6270732e737667)](https://packagist.org/packages/siibnu/wilayah-indonesia-bps)[![License: MIT](https://camo.githubusercontent.com/0628db17b69ba41617ef71a84ccd939c38408613417f481a02784541d63889f9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736969626e752f77696c617961682d696e646f6e657369612d6270732e737667)](LICENSE)

PHP library for Indonesian administrative regions (province, regency/city, district, village) based on [SIG BPS](https://sig.bps.go.id).

Data is shipped as static PHP files per period — **no API call at runtime**.

Library PHP untuk data wilayah Indonesia (provinsi, kabupaten/kota, kecamatan, desa/kelurahan). Data sudah di-bundle; aplikasi hanya membaca file lokal.

Features
--------

[](#features)

- Cascade lookup: province → regency → district → village
- BPS + Kemendagri (DAGRI) codes and names on every record
- Period-aware dataset (default: latest available period)
- Zero runtime dependency on BPS network for consumers
- CLI tools for maintainers to sync/update data from BPS

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

[](#requirements)

- PHP `^8.2`

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

[](#installation)

```
composer require siibnu/wilayah-indonesia-bps
```

Packagist: [siibnu/wilayah-indonesia-bps](https://packagist.org/packages/siibnu/wilayah-indonesia-bps)

Quick start
-----------

[](#quick-start)

```
use Siibnu\WilayahIndonesiaBps\Wilayah;

$wilayah = new Wilayah();                 // latest period
// $wilayah = new Wilayah('2025_2.2025'); // specific period

$provinces = $wilayah->provinces();
$regencies = $wilayah->regencies('11');       // Aceh
$districts = $wilayah->districts('1101');     // Simeulue
$villages  = $wilayah->villages('1101010');   // Teupah Selatan

$village = $wilayah->village('1101010001');
echo $village?->bpsName;   // LATIUNG
echo $village?->dagriCode; // 11.09.07.2008

// Auto-detect level by BPS code length (2 / 4 / 7 / 10)
$item = $wilayah->find('1101010001');
```

### Available methods

[](#available-methods)

MethodReturns`periods()``list``period()`active `Period``provinces()` / `province($code)`list / single`regencies($provinceCode)` / `regency($code)`list / single`districts($regencyCode)` / `district($code)`list / single`villages($districtCode)` / `village($code)`list / single`find($bpsCode)``Region|null``syncStatuses()`sync checklist per period`withPeriod($code)`new instance for another period### DTO fields

[](#dto-fields)

`Province`, `Regency`, `District`, and `Village` extend `Region`:

PropertyAPI field`bpsCode``kode_bps``bpsName``nama_bps``dagriCode``kode_dagri``dagriName``nama_dagri`Use `$item->toArray()` when you need a plain array (e.g. JSON API).

Available data (sync status)
----------------------------

[](#available-data-sync-status)

PeriodProvinceRegencyDistrictVillageComplete`2025_2.2025`✅✅✅✅✅`2025_1.2025`❌❌❌❌❌`2024_1.2025`❌❌❌❌❌`2024_1.2022`❌❌❌❌❌`2023_1.2022`❌❌❌❌❌`2020_1.2020`❌❌❌❌❌`2019_1.2019`❌❌❌❌❌Check locally after updates:

```
vendor/bin/status
# or
composer run-script status
```

### TODO sync

[](#todo-sync)

- `2025_2.2025` — complete (province → village)
- `2025_1.2025`
- `2024_1.2025`
- `2024_1.2022`
- `2023_1.2022`
- `2020_1.2020`
- `2019_1.2019`

Data layout
-----------

[](#data-layout)

```
resources/data/
├── periods.php
└── 2025_2_2025/
    ├── provinces.php
    ├── regencies/{provinceCode}.php
    ├── districts/{regencyCode}.php
    └── villages/{districtCode}.php

```

Maintainer: sync from BPS
-------------------------

[](#maintainer-sync-from-bps)

These CLI tools fetch from SIG BPS and rewrite static files. **Not needed in production apps** — only for package maintainers (or forks updating data).

```
# Refresh period list
php bin/update-periods --force

# Full pipeline for one period
php bin/update-all --period=2025_2.2025 --concurrency=8

# Per level
php bin/update-provinces --period=2025_2.2025
php bin/update-regencies --period=2025_2.2025 --concurrency=8
php bin/update-districts --period=2025_2.2025 --concurrency=8
php bin/update-villages --period=2025_2.2025 --concurrency=8

# Single parent
php bin/update-regencies --period=2025_2.2025 --parent=11

# Force overwrite local cache files
php bin/update-all --period=2025_2.2025 --force --concurrency=8
```

Default behavior skips existing files (resume-friendly). Use `--force` to refresh.

Notes
-----

[](#notes)

- **Consumers** use the `Wilayah` class to read data.
- **Compilers / `bin/update-*`** are for generating data from BPS, not for app runtime.
- Regional data originates from BPS / Kemendagri; this package only provides structured access.
- This project is not affiliated with BPS.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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

Every ~0 days

Total

2

Last Release

1d ago

PHP version history (2 changes)v1.0.0PHP ^8.1

v1.0.1PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/265dea9794d5062c30e946bb27271f9b14c0c11a513ee438f7a558385c77d11e?d=identicon)[siibnu99](/maintainers/siibnu99)

---

Top Contributors

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

---

Tags

indonesiaprovinsikabupatenkecamatanwilayahdesabpskode-wilayahdagri

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/siibnu-wilayah-indonesia-bps/health.svg)

```
[![Health](https://phpackages.com/badges/siibnu-wilayah-indonesia-bps/health.svg)](https://phpackages.com/packages/siibnu-wilayah-indonesia-bps)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k6.0M763](/packages/sylius-sylius)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36826.2k2](/packages/telnyx-telnyx-php)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.7M10](/packages/chargebee-chargebee-php)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k19](/packages/tempest-framework)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86337.5k](/packages/flow-php-flow)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k441.1k7](/packages/theodo-group-llphant)

PHPackages © 2026

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