faker.providers.address.en_PH

Package Contents

Classes

AddressProvider

Provider

Provider for addresses for en_PH locale

Attributes

ElementsType

faker.providers.address.en_PH.ElementsType
class faker.providers.address.en_PH.AddressProvider(generator: Any)

Bases: faker.providers.BaseProvider

city_suffixes: faker.providers.ElementsType[str] = ['Ville']
street_suffixes: faker.providers.ElementsType[str] = ['Street']
city_formats: faker.providers.ElementsType[str] = ('{{first_name}} {{city_suffix}}',)
street_name_formats: faker.providers.ElementsType[str] = ('{{last_name}} {{street_suffix}}',)
street_address_formats: faker.providers.ElementsType[str] = ('{{building_number}} {{street_name}}',)
address_formats: faker.providers.ElementsType[str] = ('{{street_address}} {{postcode}} {{city}}',)
building_number_formats: faker.providers.ElementsType[str] = ('##',)
postcode_formats: faker.providers.ElementsType[str] = ('#####',)
countries: faker.providers.ElementsType[str]
ALPHA_2 = 'alpha-2'
ALPHA_3 = 'alpha-3'
alpha_2_country_codes: faker.providers.ElementsType[str]
alpha_3_country_codes: faker.providers.ElementsType[str]
city_suffix() str
Example

‘town’

street_suffix() str
Example

‘Avenue’

building_number() str
Example

‘791’

city() str
Example

‘Sashabury’

street_name() str
Example

‘Crist Parks’

street_address() str
Example

‘791 Crist Parks’

postcode() str
Example

86039-9874

address() str
Example

‘791 Crist Parks, Sashabury, IL 86039-9874’

country() str
country_code(representation: str = ALPHA_2) str
current_country_code() str
current_country() str
class faker.providers.address.en_PH.Provider(generator: Any)

Bases: faker.providers.address.Provider

Provider for addresses for en_PH locale

Like many things in the Philippines, even addresses are more complicated than necessary. This provider is already a gross oversimplification, and it is still a lot more complicated VS providers from other locales despite taking shortcuts. Below are some tidbits of information that, as a whole, shaped the design decisions of this provider.

  • There are many levels of geopolitical division, thus many levels of local government:
    • There are three major island groups - Luzon, Visayas, Mindanao

    • Those major groups are divided into 17 different regions.

    • Each region is divided into provinces with the exception of the National Capital Region aka Metro Manila.

    • Each province is composed of multiple cities/municipalities.

    • Metro Manila, like a province, is composed of multiple cities/municipalities, but it is a region.

    • Each city/municipality is composed of multiple smaller local government units called barangays.

    • In some places, some barangays are divided further, and as of 2019, there are 42,045 barangays on record.

  • Metro Manila is part of Luzon geographically, but it is almost always treated as a separate entity politically, economically, statistically, and so on, since it is home to around 13% of the population despite being only around 0.2% of the country’s total land area.

  • Names of cities, municipalities, and barangays vary a lot. Furthermore, if a place has a non-English name, there will almost always be no English translation and vice-versa. It is essentially impossible to generate fake city, municipality, and barangay names in a similar manner used in the other “en” locales while being locale specific.

  • Subdivisions and other higher density housing (like high-rise condominiums) are popular in real estate.

  • The 13th floor is omitted in buildings like in many parts of the world.

  • The floor number distribution is partly based on the tallest buildings in the Philippines and partly anecdotal, but the general idea is that the higher the floor number is, the lower probability of it appearing. Furthermore, as the floor number approaches the highest floors of the tallest buildings, the probability plummets further.

  • The address distribution is based on the official 2015 population census.

  • Addresses should include a barangay, but it has been dropped to keep things sane, all things considered.

  • In addition to numbered floors, buildings have ground floors and may have lower ground, upper ground, mezzanine, and basement floors. Buildings may also have units on any of those floors, but the naming scheme varies, so they have been dropped, again to keep things sane.

Sources: - https://en.wikipedia.org/wiki/Provinces_of_the_Philippines - https://en.wikipedia.org/wiki/List_of_cities_and_municipalities_in_the_Philippines - https://en.wikipedia.org/wiki/Barangay - https://en.wikipedia.org/wiki/Postal_addresses_in_the_Philippines - https://en.wikipedia.org/wiki/List_of_ZIP_codes_in_the_Philippines - https://www.phlpost.gov.ph/ - http://en.wikipedia.org/wiki/List_of_tallest_buildings_in_the_Philippines - https://psa.gov.ph/sites/default/files/attachments/hsd/pressrelease/2015%20population%20counts%20Summary_0.xlsx

metro_manila_postcodes
luzon_province_postcodes
visayas_province_postcodes
mindanao_province_postcodes
postcodes
metro_manila_lgus = ('Caloocan', 'Las Piñas', 'Makati', 'Malabon', 'Mandaluyong', 'Manila', 'Marikina',...
province_lgus = ('Aborlan', 'Abra de Ilog', 'Abucay', 'Abulug', 'Abuyog', 'Adams', 'Agdangan', 'Aglipay',...
luzon_provinces = ('Abra', 'Albay', 'Apayao', 'Aurora', 'Bataan', 'Batanes', 'Batangas', 'Benguet', 'Bulacan',...
visayas_provinces = ('Aklan', 'Antique', 'Biliran', 'Bohol', 'Capiz', 'Cebu', 'Eastern Samar', 'Guimaras', 'Iloilo',...
mindanao_provinces = ('Agusan del Norte', 'Agusan del Sur', 'Basilan', 'Bukidnon', 'Camiguin', 'Compostela Valley',...
provinces
partitioned_building_number_formats = ('{{standalone_building_number}}?', '{{standalone_building_number}} ?',...
building_unit_number_formats = ('Unit {{floor_unit_number}}', 'Room {{floor_unit_number}}', '{{floor_number}}F',...
building_name_formats = ('{{last_name}} {{building_name_suffix}}', '{{random_object_name}} {{building_name_suffix}}')
building_name_suffixes = ('Apartment', 'Apartments', 'Building', 'Building %', 'Building Tower %', 'Condominiums',...
subdivision_unit_number_formats = ('B{{subdivision_block_number}} L{{subdivision_lot_number}}', 'Block...
subdivision_name_formats = ('{{last_name}} {{subdivision_name_suffix}}', '{{random_object_name}} {{subdivision_name_suffix}}')
subdivision_name_suffixes = ('Cove', 'Cove %', 'Cove Phase %', 'Estates', 'Estates %', 'Estates Phase %', 'Grove', 'Grove...
floor_numbers
street_suffixes
street_name_formats = ('{{last_name}} {{street_suffix}}', '{{ordinal_street_number}} {{street_suffix}}',...
street_address_formats = ('{{standalone_building_number}} {{street_name}}', '{{partitioned_building_number}}...
metro_manila_address_formats = ('{{street_address}}, {{metro_manila_lgu}}, {{metro_manila_postcode}} Metro Manila',)
luzon_province_address_formats = ('{{street_address}}, {{province_lgu}}, {{luzon_province_postcode}} {{luzon_province}}',)
visayas_province_address_formats = ('{{street_address}}, {{province_lgu}}, {{visayas_province_postcode}} {{visayas_province}}',)
mindanao_province_address_formats = ('{{street_address}}, {{province_lgu}}, {{mindanao_province_postcode}} {{mindanao_province}}',)
address_formats
province
_ordinal_string(num: Union[int, str]) str
_create_postcode(postcodes: Sequence[int]) str
_create_address(address_formats: faker.providers.ElementsType[str]) str
metro_manila_postcode() str
luzon_province_postcode() str
visayas_province_postcode() str
mindanao_province_postcode() str
postcode() str
Example

86039-9874

luzon_province() str
visayas_province() str
mindanao_province() str
administrative_unit() str
standalone_building_number() str
partitioned_building_number() str
building_number() str
Example

‘791’

ordinal_street_number() str
floor_number() str
ordinal_floor_number() str
floor_unit_number() str
building_unit_number() str
building_name() str
building_name_suffix() str
subdivision_block_number() str
subdivision_lot_number() str
subdivision_unit_number() str
subdivision_name() str
subdivision_name_suffix() str
metro_manila_lgu() str
province_lgu() str
metro_manila_address() str
luzon_province_address() str
visayas_province_address() str
mindanao_province_address() str
address() str
Example

‘791 Crist Parks, Sashabury, IL 86039-9874’