Update vi_VN address provider with current administrative units and postcodes
- Dominant language
- Python
- Stars
- 19.4k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Description
The `vi_VN` address provider contains outdated Vietnamese administrative units and postcode data. It also generates limited address formats that do not closely reflect commonly used Vietnamese addresses.
### Steps to reproduce
1. Create a Faker instance using the `vi_VN` locale.
2. Generate addresses using `address()`, `city()`, `state()`, or `postcode()`.
3. Observe the generated administrative units and postcode formats.
### Expected behavior
The provider should:
- Use the current 34 provincial-level administrative units.
- Generate valid five-digit Vietnamese postcodes.
- Generate realistic building numbers, sub-streets, streets, communes, cities, and provinces.
- Return postcodes from the appropriate ranges when using `postcode_in_state()`.
### Actual behavior
The provider uses outdated administrative-unit data, generates six-digit postcodes, and supports only basic address formats.
### Proposed changes
- Update the province, municipality, abbreviation, and postcode datasets.
- Add generators for building numbers, sub-streets, streets, communes, cities, and provinces.
- Improve complete address formats.
- Expand tests for the new address components and postcode ranges.
References:
- Vietnamese administrative reforms: https://en.wikipedia.org/wiki/2025_Vietnamese_administrative_reforms
- Administrative units: https://github.com/thanglequoc/vietnamese-provinces-database
- Postcodes: https://mst.gov.vn/van-ban-phap-luat/25175.htm
Contributor guide
Research direction
Start with the vi_VN provider entry points for address(), city(), state(), postcode(), and postcode_in_state(), then locate the existing provider tests. Compare the current datasets with the referenced administrative-unit and postcode sources. Done means current 34 provincial-level units, five-digit postcodes including valid state ranges, realistic address components, and expanded tests for the new formats.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- localization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100