python-stdnum branch master updated. 1.20-2-g5aeaeff
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-stdnum branch master updated. 1.20-2-g5aeaeff
- From: Commits of the python-stdnum project <python-stdnum-commits [at] lists.arthurdejong.org>
- To: python-stdnum-commits [at] lists.arthurdejong.org
- Reply-to: python-stdnum-users [at] lists.arthurdejong.org, python-stdnum-commits [at] lists.arthurdejong.org
- Subject: python-stdnum branch master updated. 1.20-2-g5aeaeff
- Date: Sun, 19 May 2024 16:36:58 +0200 (CEST)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".
The branch, master has been updated
via 5aeaeffe58abdbfb9849c2d3a2161e8dbab59aff (commit)
from 06909964c3ad2f76dd0f474543e65bb17a520e3d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=5aeaeffe58abdbfb9849c2d3a2161e8dbab59aff
commit 5aeaeffe58abdbfb9849c2d3a2161e8dbab59aff
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Sun May 19 16:34:11 2024 +0200
Add support for Indonesian NIK
diff --git a/stdnum/id/loc.dat b/stdnum/id/loc.dat
new file mode 100644
index 0000000..f38f884
--- /dev/null
+++ b/stdnum/id/loc.dat
@@ -0,0 +1,538 @@
+# List of provinces and cities/regencies in Indonesia
+# Manually generated, based on data from:
+#
https://github.com/perlancar/perl-Locale-ID-Province/blob/master/lib/Locale/ID/Province.pm
+#
https://github.com/perlancar/perl-Locale-ID-Locality/blob/master/lib/Locale/ID/Locality.pm
+# The https://github.com/sharyanto/gudang-data-interim/ repository is sadly no
longer available
+# Apparently the data should also be available on
https://www.kemendagri.go.id/pages/data-world
+# but that page currently doesn't work at all
+
+11 iso3166_2="ID-AC" name_id="Aceh" name_en="Aceh"
+ 01 name_id="SIMEULUE"
+ 02 name_id="ACEH SINGKIL"
+ 03 name_id="ACEH SELATAN"
+ 04 name_id="ACEH TENGGARA"
+ 05 name_id="ACEH TIMUR"
+ 06 name_id="ACEH TENGAH"
+ 07 name_id="ACEH BARAT"
+ 08 name_id="ACEH BESAR"
+ 09 name_id="PIDIE"
+ 10 name_id="BIREUEN"
+ 11 name_id="ACEH UTARA"
+ 12 name_id="ACEH BARAT DAYA"
+ 13 name_id="GAYO LUES"
+ 14 name_id="ACEH TAMIANG"
+ 15 name_id="NAGAN RAYA"
+ 16 name_id="ACEH JAYA"
+ 17 name_id="BENER MERIAH"
+ 18 name_id="PIDIE JAYA"
+ 71 name_id="BANDA ACEH"
+ 72 name_id="SABANG"
+ 73 name_id="LANGSA"
+ 74 name_id="LHOKSEUMAWE"
+ 75 name_id="SUBULUSSALAM"
+12 iso3166_2="ID-SU" name_id="Sumatera Utara" name_en="North Sumatra"
+ 01 name_id="NIAS"
+ 02 name_id="MANDAILING NATAL"
+ 03 name_id="TAPANULI SELATAN"
+ 04 name_id="TAPANULI TENGAH"
+ 05 name_id="TAPANULI UTARA"
+ 06 name_id="TOBA SAMOSIR"
+ 07 name_id="LABUHAN BATU"
+ 08 name_id="ASAHAN"
+ 09 name_id="SIMALUNGUN"
+ 10 name_id="DAIRI"
+ 11 name_id="KARO"
+ 12 name_id="DELI SERDANG"
+ 13 name_id="LANGKAT"
+ 14 name_id="NIAS SELATAN"
+ 15 name_id="HUMBANG HASUNDUTAN"
+ 16 name_id="PAKPAK BHARAT"
+ 17 name_id="SAMOSIR"
+ 18 name_id="SERDANG BEDAGAI"
+ 19 name_id="BATU BARA"
+ 20 name_id="PADANG LAWAS UTARA"
+ 21 name_id="PADANG LAWAS"
+ 22 name_id="LABUHAN BATU SELATAN"
+ 23 name_id="LABUHAN BATU UTARA"
+ 24 name_id="NIAS UTARA"
+ 25 name_id="NIAS BARAT"
+ 71 name_id="SIBOLGA"
+ 72 name_id="TANJUNG BALAI"
+ 73 name_id="PEMATANG SIANTAR"
+ 74 name_id="TEBING TINGGI"
+ 75 name_id="MEDAN"
+ 76 name_id="BINJAI"
+ 77 name_id="PADANGSIDIMPUAN"
+ 78 name_id="GUNUNGSITOLI"
+13 iso3166_2="ID-SB" name_id="Sumatera Barat" name_en="West Sumatra"
+ 01 name_id="KEPULAUAN MENTAWAI"
+ 02 name_id="PESISIR SELATAN"
+ 03 name_id="SOLOK"
+ 04 name_id="SIJUNJUNG"
+ 05 name_id="TANAH DATAR"
+ 06 name_id="PADANG PARIAMAN"
+ 07 name_id="AGAM"
+ 08 name_id="LIMA PULUH KOTA"
+ 09 name_id="PASAMAN"
+ 10 name_id="SOLOK SELATAN"
+ 11 name_id="DHARMAS RAYA"
+ 12 name_id="PASAMAN BARAT"
+ 71 name_id="PADANG"
+ 72 name_id="SOLOK"
+ 73 name_id="SAWAH LUNTO"
+ 74 name_id="PADANG PANJANG"
+ 75 name_id="BUKITTINGGI"
+ 76 name_id="PAYAKUMBUH"
+ 77 name_id="PARIAMAN"
+14 iso3166_2="ID-RI" name_id="Riau" name_en="Riau"
+ 01 name_id="KUANTAN SINGINGI"
+ 02 name_id="INDRAGIRI HULU"
+ 03 name_id="INDRAGIRI HILIR"
+ 04 name_id="PELALAWAN"
+ 05 name_id="SIAK"
+ 06 name_id="KAMPAR"
+ 07 name_id="ROKAN HULU"
+ 08 name_id="BENGKALIS"
+ 09 name_id="ROKAN HILIR"
+ 10 name_id="KEPULAUAN MERANTI"
+ 71 name_id="PEKANBARU"
+ 73 name_id="DUMAI"
+15 iso3166_2="ID-JA" name_id="Jambi" name_en="Jambi"
+ 01 name_id="KERINCI"
+ 02 name_id="MERANGIN"
+ 03 name_id="SAROLANGUN"
+ 04 name_id="BATANG HARI"
+ 05 name_id="MUARO JAMBI"
+ 06 name_id="TANJUNG JABUNG TIMUR"
+ 07 name_id="TANJUNG JABUNG BARAT"
+ 08 name_id="TEBO"
+ 09 name_id="BUNGO"
+ 71 name_id="JAMBI"
+ 72 name_id="SUNGAI PENUH"
+16 iso3166_2="ID-SS" name_id="Sumatera Selatan" name_en="South Sumatra"
+ 01 name_id="OGAN KOMERING ULU"
+ 02 name_id="OGAN KOMERING ILIR"
+ 03 name_id="MUARA ENIM"
+ 04 name_id="LAHAT"
+ 05 name_id="MUSI RAWAS"
+ 06 name_id="MUSI BANYUASIN"
+ 07 name_id="BANYU ASIN"
+ 08 name_id="OGAN KOMERING ULU SELATAN"
+ 09 name_id="OGAN KOMERING ULU TIMUR"
+ 10 name_id="OGAN ILIR"
+ 11 name_id="EMPAT LAWANG"
+ 71 name_id="PALEMBANG"
+ 72 name_id="PRABUMULIH"
+ 73 name_id="PAGAR ALAM"
+ 74 name_id="LUBUKLINGGAU"
+17 iso3166_2="ID-BE" name_id="Bengkulu" name_en="Bengkulu"
+ 01 name_id="BENGKULU SELATAN"
+ 02 name_id="REJANG LEBONG"
+ 03 name_id="BENGKULU UTARA"
+ 04 name_id="KAUR"
+ 05 name_id="SELUMA"
+ 06 name_id="MUKOMUKO"
+ 07 name_id="LEBONG"
+ 08 name_id="KEPAHIANG"
+ 09 name_id="BENGKULU TENGAH"
+ 71 name_id="BENGKULU"
+18 iso3166_2="ID-LA" name_id="Lampung" name_en="Lampung"
+ 01 name_id="LAMPUNG BARAT"
+ 02 name_id="TANGGAMUS"
+ 03 name_id="LAMPUNG SELATAN"
+ 04 name_id="LAMPUNG TIMUR"
+ 05 name_id="LAMPUNG TENGAH"
+ 06 name_id="LAMPUNG UTARA"
+ 07 name_id="WAY KANAN"
+ 08 name_id="TULANGBAWANG"
+ 09 name_id="PESAWARAN"
+ 10 name_id="PRINGSEWU"
+ 11 name_id="MESUJI"
+ 12 name_id="TULANGBAWANG BARAT"
+ 71 name_id="BANDAR LAMPUNG"
+ 72 name_id="METRO"
+19 iso3166_2="ID-BB" name_id="Kepulauan Bangka Belitung" name_en="Bangka
Belitung Islands"
+ 01 name_id="BANGKA"
+ 02 name_id="BELITUNG"
+ 03 name_id="BANGKA BARAT"
+ 04 name_id="BANGKA TENGAH"
+ 05 name_id="BANGKA SELATAN"
+ 06 name_id="BELITUNG TIMUR"
+ 71 name_id="PANGKAL PINANG"
+21 iso3166_2="ID-KR" name_id="Kepulauan Riau" name_en="Riau Islands"
+ 01 name_id="KARIMUN"
+ 02 name_id="BINTAN"
+ 03 name_id="NATUNA"
+ 04 name_id="LINGGA"
+ 05 name_id="KEPULAUAN ANAMBAS"
+ 71 name_id="BATAM"
+ 72 name_id="TANJUNG PINANG"
+31 iso3166_2="ID-JK" name_id="Daerah Khusus Ibukota Jakarta" name_en="Jakarta
Special Capital Territory"
+ 01 name_id="KEPULAUAN SERIBU"
+ 71 name_id="JAKARTA SELATAN"
+ 72 name_id="JAKARTA TIMUR"
+ 73 name_id="JAKARTA PUSAT"
+ 74 name_id="JAKARTA BARAT"
+ 75 name_id="JAKARTA UTARA"
+32 iso3166_2="ID-JB" name_id="Jawa Barat" name_en="West Java"
+ 01 name_id="BOGOR"
+ 02 name_id="SUKABUMI"
+ 03 name_id="CIANJUR"
+ 04 name_id="BANDUNG"
+ 05 name_id="GARUT"
+ 06 name_id="TASIKMALAYA"
+ 07 name_id="CIAMIS"
+ 08 name_id="KUNINGAN"
+ 09 name_id="CIREBON"
+ 10 name_id="MAJALENGKA"
+ 11 name_id="SUMEDANG"
+ 12 name_id="INDRAMAYU"
+ 13 name_id="SUBANG"
+ 14 name_id="PURWAKARTA"
+ 15 name_id="KARAWANG"
+ 16 name_id="BEKASI"
+ 17 name_id="BANDUNG BARAT"
+ 71 name_id="BOGOR"
+ 72 name_id="SUKABUMI"
+ 73 name_id="BANDUNG"
+ 74 name_id="CIREBON"
+ 75 name_id="BEKASI"
+ 76 name_id="DEPOK"
+ 77 name_id="CIMAHI"
+ 78 name_id="TASIKMALAYA"
+ 79 name_id="BANJAR"
+33 iso3166_2="ID-JT" name_id="Jawa Tengah" name_en="Central Java"
+ 01 name_id="CILACAP"
+ 02 name_id="BANYUMAS"
+ 03 name_id="PURBALINGGA"
+ 04 name_id="BANJARNEGARA"
+ 05 name_id="KEBUMEN"
+ 06 name_id="PURWOREJO"
+ 07 name_id="WONOSOBO"
+ 08 name_id="MAGELANG"
+ 09 name_id="BOYOLALI"
+ 10 name_id="KLATEN"
+ 11 name_id="SUKOHARJO"
+ 12 name_id="WONOGIRI"
+ 13 name_id="KARANGANYAR"
+ 14 name_id="SRAGEN"
+ 15 name_id="GROBOGAN"
+ 16 name_id="BLORA"
+ 17 name_id="REMBANG"
+ 18 name_id="PATI"
+ 19 name_id="KUDUS"
+ 20 name_id="JEPARA"
+ 21 name_id="DEMAK"
+ 22 name_id="SEMARANG"
+ 23 name_id="TEMANGGUNG"
+ 24 name_id="KENDAL"
+ 25 name_id="BATANG"
+ 26 name_id="PEKALONGAN"
+ 27 name_id="PEMALANG"
+ 28 name_id="TEGAL"
+ 29 name_id="BREBES"
+ 71 name_id="MAGELANG"
+ 72 name_id="SURAKARTA"
+ 73 name_id="SALATIGA"
+ 74 name_id="SEMARANG"
+ 75 name_id="PEKALONGAN"
+ 76 name_id="TEGAL"
+34 iso3166_2="ID-YO" name_id="Daerah Istimewa Yogyakarta" name_en="Yogyakarta
Special Territory"
+ 01 name_id="KULON PROGO"
+ 02 name_id="BANTUL"
+ 03 name_id="GUNUNG KIDUL"
+ 04 name_id="SLEMAN"
+ 71 name_id="YOGYAKARTA"
+35 iso3166_2="ID-JI" name_id="Jawa Timur" name_en="East Java"
+ 01 name_id="PACITAN"
+ 02 name_id="PONOROGO"
+ 03 name_id="TRENGGALEK"
+ 04 name_id="TULUNGAGUNG"
+ 05 name_id="BLITAR"
+ 06 name_id="KEDIRI"
+ 07 name_id="MALANG"
+ 08 name_id="LUMAJANG"
+ 09 name_id="JEMBER"
+ 10 name_id="BANYUWANGI"
+ 11 name_id="BONDOWOSO"
+ 12 name_id="SITUBONDO"
+ 13 name_id="PROBOLINGGO"
+ 14 name_id="PASURUAN"
+ 15 name_id="SIDOARJO"
+ 16 name_id="MOJOKERTO"
+ 17 name_id="JOMBANG"
+ 18 name_id="NGANJUK"
+ 19 name_id="MADIUN"
+ 20 name_id="MAGETAN"
+ 21 name_id="NGAWI"
+ 22 name_id="BOJONEGORO"
+ 23 name_id="TUBAN"
+ 24 name_id="LAMONGAN"
+ 25 name_id="GRESIK"
+ 26 name_id="BANGKALAN"
+ 27 name_id="SAMPANG"
+ 28 name_id="PAMEKASAN"
+ 29 name_id="SUMENEP"
+ 71 name_id="KEDIRI"
+ 72 name_id="BLITAR"
+ 73 name_id="MALANG"
+ 74 name_id="PROBOLINGGO"
+ 75 name_id="PASURUAN"
+ 76 name_id="MOJOKERTO"
+ 77 name_id="MADIUN"
+ 78 name_id="SURABAYA"
+ 79 name_id="BATU"
+36 iso3166_2="ID-BT" name_id="Banten" name_en="Banten"
+ 01 name_id="PANDEGLANG"
+ 02 name_id="LEBAK"
+ 03 name_id="TANGERANG"
+ 04 name_id="SERANG"
+ 71 name_id="TANGERANG"
+ 72 name_id="CILEGON"
+ 73 name_id="SERANG"
+ 74 name_id="TANGERANG SELATAN"
+51 iso3166_2="ID-BA" name_id="Bali" name_en="Bali"
+ 01 name_id="JEMBRANA"
+ 02 name_id="TABANAN"
+ 03 name_id="BADUNG"
+ 04 name_id="GIANYAR"
+ 05 name_id="KLUNGKUNG"
+ 06 name_id="BANGLI"
+ 07 name_id="KARANG ASEM"
+ 08 name_id="BULELENG"
+ 71 name_id="DENPASAR"
+52 iso3166_2="ID-NB" name_id="Nusa Tenggara Barat" name_en="West Nusa Tenggara"
+ 01 name_id="LOMBOK BARAT"
+ 02 name_id="LOMBOK TENGAH"
+ 03 name_id="LOMBOK TIMUR"
+ 04 name_id="SUMBAWA"
+ 05 name_id="DOMPU"
+ 06 name_id="BIMA"
+ 07 name_id="SUMBAWA BARAT"
+ 08 name_id="LOMBOK UTARA"
+ 71 name_id="MATARAM"
+ 72 name_id="BIMA"
+53 iso3166_2="ID-NT" name_id="Nusa Tenggara Timur" name_en="East Nusa Tenggara"
+ 01 name_id="SUMBA BARAT"
+ 02 name_id="SUMBA TIMUR"
+ 03 name_id="KUPANG"
+ 04 name_id="TIMOR TENGAH SELATAN"
+ 05 name_id="TIMOR TENGAH UTARA"
+ 06 name_id="BELU"
+ 07 name_id="ALOR"
+ 08 name_id="LEMBATA"
+ 09 name_id="FLORES TIMUR"
+ 10 name_id="SIKKA"
+ 11 name_id="ENDE"
+ 12 name_id="NGADA"
+ 13 name_id="MANGGARAI"
+ 14 name_id="ROTE NDAO"
+ 15 name_id="MANGGARAI BARAT"
+ 16 name_id="SUMBA TENGAH"
+ 17 name_id="SUMBA BARAT DAYA"
+ 18 name_id="NAGEKEO"
+ 19 name_id="MANGGARAI TIMUR"
+ 20 name_id="SABU RAIJUA"
+ 71 name_id="KUPANG"
+61 iso3166_2="ID-KB" name_id="Kalimantan Barat" name_en="West Kalimantan"
+ 01 name_id="SAMBAS"
+ 02 name_id="BENGKAYANG"
+ 03 name_id="LANDAK"
+ 04 name_id="PONTIANAK"
+ 05 name_id="SANGGAU"
+ 06 name_id="KETAPANG"
+ 07 name_id="SINTANG"
+ 08 name_id="KAPUAS HULU"
+ 09 name_id="SEKADAU"
+ 10 name_id="MELAWI"
+ 11 name_id="KAYONG UTARA"
+ 12 name_id="KUBU RAYA"
+ 71 name_id="PONTIANAK"
+ 72 name_id="SINGKAWANG"
+62 iso3166_2="ID-KT" name_id="Kalimantan Tengah" name_en="Central Kalimantan"
+ 01 name_id="KOTAWARINGIN BARAT"
+ 02 name_id="KOTAWARINGIN TIMUR"
+ 03 name_id="KAPUAS"
+ 04 name_id="BARITO SELATAN"
+ 05 name_id="BARITO UTARA"
+ 06 name_id="SUKAMARA"
+ 07 name_id="LAMANDAU"
+ 08 name_id="SERUYAN"
+ 09 name_id="KATINGAN"
+ 10 name_id="PULANG PISAU"
+ 11 name_id="GUNUNG MAS"
+ 12 name_id="BARITO TIMUR"
+ 13 name_id="MURUNG RAYA"
+ 71 name_id="PALANGKA RAYA"
+63 iso3166_2="ID-KS" name_id="Kalimantan Selatan" name_en="South Kalimantan"
+ 01 name_id="TANAH LAUT"
+ 02 name_id="BARU"
+ 03 name_id="BANJAR"
+ 04 name_id="BARITO KUALA"
+ 05 name_id="TAPIN"
+ 06 name_id="HULU SUNGAI SELATAN"
+ 07 name_id="HULU SUNGAI TENGAH"
+ 08 name_id="HULU SUNGAI UTARA"
+ 09 name_id="TABALONG"
+ 10 name_id="TANAH BUMBU"
+ 11 name_id="BALANGAN"
+ 71 name_id="BANJARMASIN"
+ 72 name_id="BANJAR BARU"
+64 iso3166_2="ID-KI" name_id="Kalimantan Timur" name_en="East Kalimantan"
+ 01 name_id="PASIR"
+ 02 name_id="KUTAI BARAT"
+ 03 name_id="KUTAI KARTANEGARA"
+ 04 name_id="KUTAI TIMUR"
+ 05 name_id="BERAU"
+ 06 name_id="MALINAU"
+ 07 name_id="BULUNGAN"
+ 08 name_id="NUNUKAN"
+ 09 name_id="PENAJAM PASER UTARA"
+ 10 name_id="TANA TIDUNG"
+ 71 name_id="BALIKPAPAN"
+ 72 name_id="SAMARINDA"
+ 73 name_id="TARAKAN"
+ 74 name_id="BONTANG"
+71 iso3166_2="ID-SA" name_id="Sulawesi Utara" name_en="North Sulawesi"
+ 01 name_id="BOLAANG MONGONDOW"
+ 02 name_id="MINAHASA"
+ 03 name_id="KEPULAUAN SANGIHE"
+ 04 name_id="KEPULAUAN TALAUD"
+ 05 name_id="MINAHASA SELATAN"
+ 06 name_id="MINAHASA UTARA"
+ 07 name_id="BOLAANG MONGONDOW UTARA"
+ 08 name_id="SIAU TAGULANDANG BIARO"
+ 09 name_id="MINAHASA TENGGARA"
+ 10 name_id="BOLAANG MONGONDOW SELATAN"
+ 11 name_id="BOLAANG MONGONDOW TIMUR"
+ 71 name_id="MANADO"
+ 72 name_id="BITUNG"
+ 73 name_id="TOMOHON"
+ 74 name_id="KOTAMOBAGU"
+72 iso3166_2="ID-ST" name_id="Sulawesi Tengah" name_en="Central Sulawesi"
+ 01 name_id="BANGGAI KEPULAUAN"
+ 02 name_id="BANGGAI"
+ 03 name_id="MOROWALI"
+ 04 name_id="POSO"
+ 05 name_id="DONGGALA"
+ 06 name_id="TOLI-TOLI"
+ 07 name_id="BUOL"
+ 08 name_id="PARIGI MOUTONG"
+ 09 name_id="TOJO UNA-UNA"
+ 10 name_id="SIGI"
+ 71 name_id="PALU"
+73 iso3166_2="ID-SN" name_id="Sulawesi Selatan" name_en="South Sulawesi"
+ 01 name_id="KEPULAUAN SELAYAR"
+ 02 name_id="BULUKUMBA"
+ 03 name_id="BANTAENG"
+ 04 name_id="JENEPONTO"
+ 05 name_id="TAKALAR"
+ 06 name_id="GOWA"
+ 07 name_id="SINJAI"
+ 08 name_id="MAROS"
+ 09 name_id="PANGKAJENE DAN KEPULAUAN"
+ 10 name_id="BARRU"
+ 11 name_id="BONE"
+ 12 name_id="SOPPENG"
+ 13 name_id="WAJO"
+ 14 name_id="SIDENRENG RAPPANG"
+ 15 name_id="PINRANG"
+ 16 name_id="ENREKANG"
+ 17 name_id="LUWU"
+ 18 name_id="TANA TORAJA"
+ 22 name_id="LUWU UTARA"
+ 25 name_id="LUWU TIMUR"
+ 26 name_id="TORAJA UTARA"
+ 71 name_id="MAKASSAR"
+ 72 name_id="PAREPARE"
+ 73 name_id="PALOPO"
+74 iso3166_2="ID-SG" name_id="Sulawesi Tenggara" name_en="South East Sulawesi"
+ 01 name_id="BUTON"
+ 02 name_id="MUNA"
+ 03 name_id="KONAWE"
+ 04 name_id="KOLAKA"
+ 05 name_id="KONAWE SELATAN"
+ 06 name_id="BOMBANA"
+ 07 name_id="WAKATOBI"
+ 08 name_id="KOLAKA UTARA"
+ 09 name_id="BUTON UTARA"
+ 10 name_id="KONAWE UTARA"
+ 71 name_id="KENDARI"
+ 72 name_id="BAU-BAU"
+75 iso3166_2="ID-GO" name_id="Gorontalo" name_en="Gorontalo"
+ 01 name_id="BOALEMO"
+ 02 name_id="GORONTALO"
+ 03 name_id="POHUWATO"
+ 04 name_id="BONE BOLANGO"
+ 05 name_id="GORONTALO UTARA"
+ 71 name_id="GORONTALO"
+76 iso3166_2="ID-SR" name_id="Sulawesi Barat" name_en="West Sulawesi"
+ 01 name_id="MAJENE"
+ 02 name_id="POLEWALI MANDAR"
+ 03 name_id="MAMASA"
+ 04 name_id="MAMUJU"
+ 05 name_id="MAMUJU UTARA"
+81 iso3166_2="ID-MA" name_id="Maluku" name_en="Maluku"
+ 01 name_id="MALUKU TENGGARA BARAT"
+ 02 name_id="MALUKU TENGGARA"
+ 03 name_id="MALUKU TENGAH"
+ 04 name_id="BURU"
+ 05 name_id="KEPULAUAN ARU"
+ 06 name_id="SERAM BAGIAN BARAT"
+ 07 name_id="SERAM BAGIAN TIMUR"
+ 08 name_id="MALUKU BARAT DAYA"
+ 09 name_id="BURU SELATAN"
+ 71 name_id="AMBON"
+ 72 name_id="TUAL"
+82 iso3166_2="ID-MU" name_id="Maluku Utara" name_en="North Maluku"
+ 01 name_id="HALMAHERA BARAT"
+ 02 name_id="HALMAHERA TENGAH"
+ 03 name_id="KEPULAUAN SULA"
+ 04 name_id="HALMAHERA SELATAN"
+ 05 name_id="HALMAHERA UTARA"
+ 06 name_id="HALMAHERA TIMUR"
+ 07 name_id="PULAU MOROTAI"
+ 71 name_id="TERNATE"
+ 72 name_id="TIDORE KEPULAUAN"
+91 iso3166_2="ID-PB" name_id="Papua Barat" name_en="West Papua"
+ 01 name_id="FAKFAK"
+ 02 name_id="KAIMANA"
+ 03 name_id="TELUK WONDAMA"
+ 04 name_id="TELUK BINTUNI"
+ 05 name_id="MANOKWARI"
+ 06 name_id="SORONG SELATAN"
+ 07 name_id="SORONG"
+ 08 name_id="RAJA AMPAT"
+ 09 name_id="TAMBRAUW"
+ 10 name_id="MAYBRAT"
+ 71 name_id="SORONG"
+94 iso3166_2="ID-PA" name_id="Papua" name_en="Papua"
+ 01 name_id="MERAUKE"
+ 02 name_id="JAYAWIJAYA"
+ 03 name_id="JAYAPURA"
+ 04 name_id="NABIRE"
+ 08 name_id="YAPEN WAROPEN"
+ 09 name_id="BIAK NUMFOR"
+ 10 name_id="PANIAI"
+ 11 name_id="PUNCAK JAYA"
+ 12 name_id="MIMIKA"
+ 13 name_id="BOVEN DIGOEL"
+ 14 name_id="MAPPI"
+ 15 name_id="ASMAT"
+ 16 name_id="YAHUKIMO"
+ 17 name_id="PEGUNUNGAN BINTANG"
+ 18 name_id="TOLIKARA"
+ 19 name_id="SARMI"
+ 20 name_id="KEEROM"
+ 26 name_id="WAROPEN"
+ 27 name_id="SUPIORI"
+ 28 name_id="MAMBERAMO RAYA"
+ 29 name_id="NDUGA"
+ 30 name_id="LANNY JAYA"
+ 31 name_id="MAMBERAMO TENGAH"
+ 32 name_id="YALIMO"
+ 33 name_id="PUNCAK"
+ 34 name_id="DOGIYAI"
+ 35 name_id="INTAN JAYA"
+ 36 name_id="DEIYAI"
+ 71 name_id="JAYAPURA"
diff --git a/stdnum/id/nik.py b/stdnum/id/nik.py
new file mode 100644
index 0000000..18cbb0d
--- /dev/null
+++ b/stdnum/id/nik.py
@@ -0,0 +1,119 @@
+# nik.py - functions for handling Indonesian NIK numbers
+# coding: utf-8
+#
+# Copyright (C) 2024 Arthur de Jong
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA
+
+"""NIK (Nomor Induk Kependudukan, Indonesian identity number).
+
+
+The Nomor Induk Kependudukan (NIK, Population Identification Number,
+sometimes known as Nomor Kartu Tanda Penduduk or Nomor KTP) is issued to
+Indonesian citizens.
+
+The number consists of 16 digits in the format PPRRSSDDMMYYXXXX where PPRRSS
+(province, city/district, sub-district) indicates the place of residence when
+the number was issued. It is followed by a DDMMYY date of birth (for female
+40 is added to the day). The last 4 digits are used to make the number
+unique.
+
+More information:
+
+* https://id.wikipedia.org/wiki/Nomor_Induk_Kependudukan
+
+>>> validate('3171011708450001')
+'3171011708450001'
+>>> validate('31710117084500')
+Traceback (most recent call last):
+ ...
+InvalidLength: ...
+>>> validate('9971011708450001') # invalid province
+Traceback (most recent call last):
+ ...
+InvalidComponent: ...
+>>> get_birth_date('3171015708450001')
+datetime.date(1945, 8, 17)
+>>> get_birth_date('3171012902001234') # 1900-02-29 doesn't exist
+datetime.date(2000, 2, 29)
+>>> get_birth_date('3171013002001234') # 1900-20-30 doesn't exist
+Traceback (most recent call last):
+ ...
+InvalidComponent: ...
+"""
+
+import datetime
+
+from stdnum.exceptions import *
+from stdnum.util import clean, isdigits
+
+
+def compact(number):
+ """Convert the number to the minimal representation.
+
+ This strips the number of any valid separators and removes
+ surrounding whitespace.
+ """
+ return clean(number, ' -.').strip()
+
+
+def get_birth_date(number, minyear=1920):
+ """Get the birth date from the person's NIK.
+
+ Note that the number only encodes the last two digits of the year so
+ this may be a century off.
+ """
+ number = compact(number)
+ day = int(number[6:8]) % 40
+ month = int(number[8:10])
+ year = int(number[10:12])
+ try:
+ return datetime.date(year + 1900, month, day)
+ except ValueError:
+ pass
+ try:
+ return datetime.date(year + 2000, month, day)
+ except ValueError:
+ raise InvalidComponent()
+
+
+def _check_registration_place(number):
+ """Use the number to look up the place of registration of the person."""
+ from stdnum import numdb
+ results = numdb.get('id/loc').info(number[:4])[0][1]
+ if not results:
+ raise InvalidComponent()
+ return results
+
+
+def validate(number):
+ """Check if the number is a valid Indonesian NIK."""
+ number = compact(number)
+ if not isdigits(number):
+ raise InvalidFormat()
+ if len(number) != 16:
+ raise InvalidLength()
+ get_birth_date(number)
+ _check_registration_place(number)
+ return number
+
+
+def is_valid(number):
+ """Check if the number is a valid Indonesian NIK."""
+ try:
+ return bool(validate(number))
+ except ValidationError:
+ return False
-----------------------------------------------------------------------
Summary of changes:
stdnum/id/loc.dat | 538 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
stdnum/id/nik.py | 119 ++++++++++++
2 files changed, 657 insertions(+)
create mode 100644 stdnum/id/loc.dat
create mode 100644 stdnum/id/nik.py
hooks/post-receive
--
python-stdnum
- python-stdnum branch master updated. 1.20-2-g5aeaeff,
Commits of the python-stdnum project