pakdatakit 2.3.0
TypeScript (npm)
Section titled “TypeScript (npm)”Breaking for TypeScript exhaustive switches
Section titled “Breaking for TypeScript exhaustive switches”BankTypehas a new member,'public-sector'(see Data below). Code that switches over everyBankTypeand checks exhaustiveness (for example with aneverdefault, or@typescript-eslint/switch-exhaustiveness-check) stops compiling until it handles the new value. Nothing else changes at runtime for such code, but National Bank of Pakistan, Sindh Bank, The Bank of Khyber and The Bank of Punjab now report'public-sector'instead of'commercial'.
- Form adapters for Joi (
pakdatakit/joi), Superstruct (pakdatakit/superstruct) and class-validator (pakdatakit/class-validator). The class-validator decorators (IsCNIC,IsPakPhone,IsPakIBAN,IsNTN,IsSTRN,IsPakLandline,IsPakPassport,IsVehiclePlate) work in NestJS DTOs without a NestJS dependency. All three libraries are optional peer dependencies. validatePassport()(pakdatakit/passport): format check for Pakistani passport numbers (two letters, seven digits). DGIP does not publish the format, so this checks the common shape only; see DATA.md.validateVehiclePlate()andparseVehiclePlate()(pakdatakit/vehicle): series, number and optional year of a vehicle registration number. Each province sets its own format, so this accepts the shape they share (1–4 letters, 1–4 digits); see DATA.md.pk.passport()andpk.vehiclePlate()in every form adapter.getPostOffice(code)andsearchPostOffices(query)(pakdatakit/postal): every delivery post office in Pakistan Post’s directory (about 2,560), as{ code, office, town, district, province }, including offices in towns and villages thatgetCityByPostalCodedoes not cover. The directory is in its own data file, so it only lands in bundles that call these two functions.- Divisions and tehsils from the 2023 census (
pakdatakit/geo):getDivisions(province?),getDivisionOfDistrict(district),getTehsils(district)andgetTehsilDistrict(tehsil, province?). The data is the census’s 30 divisions and 591 tehsils, talukas and sub-divisions. Each tehsil is recorded under its 2023 census district; for districts created since, see the census-district note in the README and DATA.md.
November 2026 audit against official sources (see AUDIT.md and DATA.md).
dataVersion is now 2026-11-17.
- Banks: added
ZTBL(Zarai Taraqiati Bank Limited) andSMFB(Sindh Microfinance Bank), both from IBANs printed by the State Bank.TMFBandTAMWare now named “Easypaisa Bank Limited” andJCMAandWMBL“Mobilink Microfinance Bank (JazzCash)”, the names on the State Bank’s lists. - Postal codes: eight codes were a nearby office’s, not the city’s own,
and are corrected from Pakistan Post’s directory: Gilgit
15100, Dera Ismail Khan29050, Tank29400, Badin72200, Thatta73130, Sujawal73050, Matiari70150and Taxila47080.47040, which was listed for Taxila, is Wah Cantt GPO and now returns Wah Cantonment. Three office names are corrected (Saidu Sharif GPO, Qila Sheikhupura GPO, University New Campus Jamshoro). - Holidays: seven
sourcelinks for 2024 to 2026 now point to the Cabinet Division notification or State Bank circular instead of a news report. No dates changed. - Postal codes from Pakistan Post’s directory:
postal-codes.jsonnow holds every office in the directory that belongs to a city on pakdatakit’s city list: 457 codes instead of 110.getCityByPostalCodekeeps its meaning (a city, ornull) and now knows 355 more codes;getPostalCodehas a code for 63 more cities;getPostalCodes,getPostalAreasandsearchPostalCodesreturn more for cities with several offices (Lahore 5 → 50, Karachi 11 → 58, Islamabad 1 → 46); andparseAddresscan fill in the city from these codes. Entries also carryprovinceand, for district headquarters,district. Offices in other towns and villages are in the newpost-offices.json(getPostOffice). Compared with 2.2.1,getCityByPostalCodegives a different answer for eight codes, all corrected in this release:47040is Wah Cantonment (was Taxila), and15700,29120,29430,70100,72220,73020and73220, which were given as the main code of a city but belong to a village office nearby, now returnnull. - Area codes: 41 more landline area codes from the numbering plan PTA
filed with the ITU: 18 in Balochistan, 8 in Khyber Pakhtunkhwa and the 15
four-digit codes of Azad Jammu and Kashmir and Gilgit-Baltistan (
05822Muzaffarabad,05811Gilgit). Numbers in these codes already validated;analyzeNumbernow also returns their area code and district, andgetAreaCodefinds them. - Bank types: new type
public-sectorfor the State Bank’s “public sector commercial banks”: National Bank of Pakistan (NBPA,NBPB), Sindh Bank, The Bank of Khyber and The Bank of Punjab. They werecommercialbefore; filter on both if you list commercial banks. - SME Bank (
SMES) is now “SME Bank Limited (in liquidation)” withactive: false: the State Bank cancelled its licence and de-scheduled it in March 2025.
- Subpath imports such as
pakdatakit/zodorpakdatakit/class-validatornow get their types under TypeScript’s oldermoduleResolution: "node", the default for"module": "commonjs"projects (including many NestJS apps). They only resolved withnode16,nodenextorbundlerbefore.
- The README’s “Why PakDataKit?” section compares PakDataKit with a typical hand-written regex, and the npm description and keywords cover all modules.
The Python and Dart packages get the same passport and vehicle plate functions in 2.3.0, checked against the shared test vectors.
Python (PyPI)
Section titled “Python (PyPI)”validate_passport(): format check for Pakistani passport numbers (two letters, seven digits). DGIP does not publish the format, so this checks the common shape only.validate_vehicle_plate()andparse_vehicle_plate(): series, number and optional year of a vehicle registration number (1–4 letters, 1–4 digits). Provinces use different formats, so this checks the shape they share.- Both are checked against the shared test vectors, like the rest of the package. See DATA.md in the repository for sources and limits.
Data (November 2026 audit, see AUDIT.md and DATA.md in the repository):
banks ZTBL (Zarai Taraqiati Bank Limited) and SMFB (Sindh Microfinance
Bank) added; TMFB/TAMW renamed “Easypaisa Bank Limited” and JCMA/WMBL
“Mobilink Microfinance Bank (JazzCash)”; eight postal codes corrected from
Pakistan Post’s directory (Gilgit, Dera Ismail Khan, Tank, Badin, Thatta,
Sujawal, Matiari, Taxila) and Wah Cantonment 47040 added; holiday source
links for 2024 to 2026 now point to official notifications.
Data depth:
get_divisions(),get_division_of_district(),get_tehsils()andget_tehsil_district(): division and tehsil lookups from the 2023 census (30 divisions, 591 tehsils). Each tehsil is recorded under its census district.get_post_office()andsearch_post_offices(): every delivery post office in Pakistan Post’s directory (about 2,560), asPostOffice(code, office, town, district, province), including offices in towns and villages.get_city_by_postal_code()still returns a city orNone, and only for post offices in a city on pakdatakit’s city list: 457 codes instead of 110. The code of an office in another town or village returnsNone; useget_post_office()for those.get_postal_code(),get_postal_codes(),get_postal_areas()andsearch_postal_codes()return more for cities with several offices.- Compared with 2.2.1,
get_city_by_postal_code()gives a different answer for eight codes:47040is Wah Cantonment (was Taxila), and15700,29120,29430,70100,72220,73020and73220, which were given as the main code of a city but belong to a village office nearby, now returnNone. - 41 more landline area codes.
- New bank type
public-sector. SME Bank (SMES) is reported as inactive.
DATA_VERSION is now 2026-11-17.
Dart (pub.dev)
Section titled “Dart (pub.dev)”Breaking for exhaustive switches
Section titled “Breaking for exhaustive switches”BankTypehas a new value,BankType.publicSector('public-sector'; see Data depth below). Dart 3 checksswitchstatements and expressions over an enum for exhaustiveness, so aswitchoverBankTypewithout a default (_) case stops compiling until it handles the new value. Nothing else changes at runtime for such code, but National Bank of Pakistan, Sindh Bank, The Bank of Khyber and The Bank of Punjab now reportBankType.publicSectorinstead ofBankType.commercial.
validatePassport(): format check for Pakistani passport numbers (two letters, seven digits). DGIP does not publish the format, so this checks the common shape only. Also aspackage:pakdatakit/passport.dart.validateVehiclePlate()andparseVehiclePlate(): series, number and optional year of a vehicle registration number (1–4 letters, 1–4 digits). Provinces use different formats, so this checks the shape they share. Also aspackage:pakdatakit/vehicle.dart.getPostOffice()andsearchPostOffices()(also inpackage:pakdatakit/postal.dart): every delivery post office in Pakistan Post’s directory (about 2,560), asPostOfficevalues (code,office,town,district,province), including offices in towns and villages thatgetCityByPostalCodedoes not cover. The directory is in its own source file and only these two functions reference it, so release builds that do not call them leave it out.- All of these are checked against the shared test vectors. See DATA.md in the repository for sources and limits.
Data (November 2026 audit, see AUDIT.md and DATA.md in the repository):
banks ZTBL (Zarai Taraqiati Bank Limited) and SMFB (Sindh Microfinance
Bank) added; TMFB/TAMW renamed “Easypaisa Bank Limited” and JCMA/WMBL
“Mobilink Microfinance Bank (JazzCash)”; eight postal codes corrected from
Pakistan Post’s directory (Gilgit, Dera Ismail Khan, Tank, Badin, Thatta,
Sujawal, Matiari, Taxila) and Wah Cantonment 47040 added; holiday source
links for 2024 to 2026 now point to official notifications.
Data depth:
getDivisions(),getDivisionOfDistrict(),getTehsils()andgetTehsilDistrict(): division and tehsil lookups from the 2023 census (30 divisions, 591 tehsils). Each tehsil is recorded under its census district, so districts created since the census may list few or no tehsils and have no division.- Postal codes now hold every office in Pakistan Post’s directory that
belongs to a listed city: 457 codes, up from 110.
getCityByPostalCodestill returns a listed city ornull, so a village office’s code returnsnull(usegetPostOfficefor those). Compared with 2.2.1 it gives a different answer for eight codes:47040is Wah Cantonment (was Taxila), and15700,29120,29430,70100,72220,73020and73220, which were given as the main code of a city but belong to a village office nearby, now returnnull. - 41 more landline area codes.
BankType.publicSector('public-sector') for public sector commercial banks;BankType.commercialnow means private commercial banks.- SME Bank (
SMES) is reported as inactive (active: false).
dataVersion is now 2026-11-17.
.NET (NuGet)
Section titled “.NET (NuGet)”First release of the .NET packages, matching version 2.3.0 of the
pakdatakit npm package.
PakDataKit: every module of the npm package for .NET 8, with no dependencies:Cnic,Phone,Networks,Numbers,Iban,Tax,Passport,VehiclePlate,Postal,Geo,WhatsApp,Currency,Words,Text,Hijri,Holidays,Address,InputandRaastQr.- Checked against the TypeScript library with over 12,000 shared test cases, also used by the Python and Dart ports, so all four give the same results.
- The datasets are embedded from the repository’s
data/folder at build time. Postal.GetPostOffice(code)andPostal.SearchPostOffices(query): every delivery post office in Pakistan Post’s directory (about 2,560), as aPostOfficerecord (Code,Office,Town,District,Province), including offices in towns and villages thatPostal.GetCitydoes not cover. The directory is parsed on first use only.PakDataKit.DataAnnotations:[Cnic],[PakPhone],[PakIban],[Ntn],[Strn],[PakLandline],[PakPassport]and[VehiclePlate].PakDataKit.FluentValidation:IsCnic(),IsPakPhone(),IsPakIban(),IsNtn(),IsStrn(),IsPakLandline(),IsPakPassport()andIsVehiclePlate().- No method throws for a string it is given to check: validators return
false, parsers and lookups returnnullor an empty list, including fornull, very long input and invalid Unicode.Try*overloads (Hijri.TryFromHijri,Holidays.TryGetHolidaysOn,WhatsApp.TryCreateLink,RaastQr.TryCreateP2P,RaastQr.TryCreateMerchant) cover the methods that throw for invalid arguments. A fuzz test checks the contract.
Data (November 2026 audit, see AUDIT.md and DATA.md in the repository):
banks ZTBL (Zarai Taraqiati Bank Limited) and SMFB (Sindh Microfinance
Bank) added; TMFB/TAMW renamed “Easypaisa Bank Limited” and JCMA/WMBL
“Mobilink Microfinance Bank (JazzCash)”; eight postal codes corrected from
Pakistan Post’s directory (Gilgit, Dera Ismail Khan, Tank, Badin, Thatta,
Sujawal, Matiari, Taxila) and Wah Cantonment 47040 added; holiday source
links for 2024 to 2026 now point to official notifications.
Division and tehsil lookups from the 2023 census added (Geo.GetDivisions,
Geo.GetDivisionOfDistrict, Geo.GetTehsils, Geo.GetTehsilDistrict): 30
divisions and 591 tehsils, each tehsil recorded under its census district.
Postal.GetCity and the other Postal lookups now cover every office in
Pakistan Post’s directory that belongs to a city on pakdatakit’s city list
(457 codes instead of 110) and still return only listed cities; offices in
other towns and villages are answered by Postal.GetPostOffice. Compared
with npm 2.2.1, Postal.GetCity gives a different answer for eight codes:
47040 is Wah Cantonment (was Taxila), and 15700, 29120, 29430,
70100, 72220, 73020 and 73220, which were given as the main code of
a city but belong to a village office nearby, now return null. 41 more
landline area codes. New bank type public-sector
(BankType.PublicSector): National Bank of Pakistan, Sindh Bank, The Bank
of Khyber and The Bank of Punjab now report it instead of Commercial, and
a switch expression over BankType without a discard arm now gets an
exhaustiveness warning (CS8509) until it handles the new value. SME Bank
(SMES) is reported as inactive.
PakData.Version is now 2026-11-17.
PHP (Packagist)
Section titled “PHP (Packagist)”First release of the PHP package, matching version 2.3.0 of the
pakdatakit npm package.
- Every module of the npm package for PHP 8.2+, with no dependencies beyond
the
mbstringextension:Cnic,Phone,Networks,Numbers,Iban,Tax,Passport,VehiclePlate,Postal,Geo,WhatsApp,Currency,Words,Text,Hijri,Holidays,Address,InputandRaastQr. - Checked against the TypeScript library with over 12,000 shared test cases, also used by the Python, Dart and .NET ports, so all give the same results.
- Does not need the
intlextension and does not depend on the locale: upper- and lower-casing, Unicode normalization, sort order and number formatting are built in. - No method throws for a string it is given to check: validators return
false, parsers and lookups returnnullor an empty array, including fornull, very long input and text that is not valid UTF-8.try*methods cover the ones that throw for invalid arguments. - Laravel 11 and 12 bridge, discovered automatically:
pk_cnic,pk_phone,pk_iban,pk_ntn,pk_strn,pk_landline,pk_passportandpk_vehicle_platerules, matching rule objects,CnicCast,PhoneCastandIbanCastEloquent casts, and English and Urdu messages. Postal::getPostOffice()andPostal::searchPostOffices(): every delivery post office in Pakistan Post’s directory (about 2,560) as aPostOffice(code,office,town,district,province), including offices in towns and villages. The directory is in its own data file, loaded only when these two methods are called.Postal::getCity()and the otherPostalmethods cover only the post offices of the cities the package lists; a village code returnsnullfromgetCity()(usegetPostOffice()). Compared with npm 2.2.1,getCity()gives a different answer for eight codes:47040is Wah Cantonment (was Taxila), and15700,29120,29430,70100,72220,73020and73220, which were given as the main code of a city but belong to a village office nearby, now returnnull.
Data (November 2026 audit, see AUDIT.md and DATA.md in the repository):
banks ZTBL (Zarai Taraqiati Bank Limited) and SMFB (Sindh Microfinance
Bank) added; TMFB/TAMW renamed “Easypaisa Bank Limited” and JCMA/WMBL
“Mobilink Microfinance Bank (JazzCash)”; eight postal codes corrected from
Pakistan Post’s directory (Gilgit, Dera Ismail Khan, Tank, Badin, Thatta,
Sujawal, Matiari, Taxila) and Wah Cantonment 47040 added; holiday source
links for 2024 to 2026 now point to official notifications.
Also added: division and tehsil lookups from the 2023 census (30 divisions,
591 tehsils; each tehsil is recorded under its census district), the full
Pakistan Post directory (about 2,560 post codes), 41 more landline area
codes, the bank type public-sector, and SME Bank is reported as inactive.
PakData::version() is now 2026-11-17.