Skip to main content

No project description provided

Project description

Vietnamese Address Format Guide


⚠️ API Note

This parser integrates with the OpenStreetMap Nominatim API to enhance address accuracy through geolocation. Because of this, some lookups may take a few seconds to complete, depending on network speed and API rate limits.


CLI Usage

When you run the command:

vietnamese_address_parser

it will print:

Vietnamese Address Parser v0.1.6
Hello! Welcome to the Vietnamese Address Parser CLI.
Usage example:
    parser = VietnameseAddressParser()
    result = parser("54-55 Bàu Cát 4, Phường 14, Tân Bình, Hồ Chí Minh")
    print(result)
⚠️ NOTE:
This parser uses the OpenStreetMap Nominatim API for geolocation enhancement.
As a result, some lookups may take a few seconds due to network latency or rate limits

1. House Number & Street Name

Format

{house_number}\s{prefix?}\.?\s{street_name}

where {prefix} is one of:

  • Đ.

or just

{house_number}\s{street_name}

Valid Examples

  • 123A/32 Trần Hưng Đạo
  • 45A đường Nguyễn Huệ
  • Đường Nam Kỳ Khởi Nghĩa
  • Đ. XVNT

Invalid:

  • Nam Kỳ Khởi Nghĩa (missing “Đường” prefix)

2. Phường / Xã

Format Options

{prefix}\.?\s{phuong_xa}

where {prefix} is one of:

  • X.
  • Xa
  • P.
  • Phuong
  • TT.
  • Thi tran

or just

{phuong_xa}

Valid Examples

  • P. 7
  • P. BN
  • P. Bến Nghé
  • Phường Bến Nghé

3. Quận / Huyện / Thị xã

Format Options

{prefix}\.?\s{quan_huyen}

where {prefix} is one of:

  • Q.
  • Quan
  • H.
  • Huyen
  • TX.
  • Thi xa

or just

{quan_huyen}

4. Tỉnh / Thành Phố

Format Options

{prefix}\.?\s{tinh_thanh_pho}

where {prefix} is one of:

  • T.
  • Tỉnh
  • TP.
  • Thanh pho

or just

{tinh_thanh_pho}

Usage in Python

Import and use the parser in your Python code:

from vietnamese_address_parser import VietnameseAddressParser

parser = VietnameseAddressParser()
address = "54-55 Bàu Cát 4, Phường 14, Tân Bình, Hồ Chí Minh"
result = parser(address)
print(result)

General Notes

  • Keep abbreviations to two segments or fewer for best search performance.
  • Separate all address components with commas, in this order:
{dia_chi}, {extra_field}, {phuong_xa}, {quan_huyen}, {tinh_thanh_pho}, {Việt Nam}

Full Examples

  1. TP. VT, Tỉnh BR-VT
  2. Đường XVNT, Quận Bình Thạnh, TP. HCM, VN
  3. Đường Lê Lợi, P.1, Q.1, TP. HCM
  4. 67 Trần Kế Xương, Q. PN, TP. HCM
  5. 218 Trần Quý Cáp, X. TL, TP. PT, Tỉnh Bình Thuận
  6. Phú Thạnh, Tân Phú, Hồ Chí Minh, Việt Nam
  7. 218 Tran Quy Cap, Thanh pho Phan Thiet, Tinh Binh Thuan
  8. 43/47 Cù Chính Lan, Thanh Khê Đông, TK, ĐN

End of Guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vietnamese_address_parser-0.1.6.tar.gz (60.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vietnamese_address_parser-0.1.6-py3-none-any.whl (61.1 kB view details)

Uploaded Python 3

File details

Details for the file vietnamese_address_parser-0.1.6.tar.gz.

File metadata

File hashes

Hashes for vietnamese_address_parser-0.1.6.tar.gz
Algorithm Hash digest
SHA256 04c4a8b5655abae76fa64c0fa1dc01a563d09bddb336652eba59baf680baca3c
MD5 73a7e277d1ffda5773ec799e4669a7af
BLAKE2b-256 870561f4d4ed9c349b2d761e8f4e12302ac4f4d120bc53e4ff8dc50cd5397643

See more details on using hashes here.

File details

Details for the file vietnamese_address_parser-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for vietnamese_address_parser-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0416f1a10ed5f48f9e753984e8981979530f1a9397dc00a0838793f1444306ad
MD5 49d0a4fea4e1697bc0567dbc05103e8e
BLAKE2b-256 6ca0b89668d21b22fed0d6a2948a06d5ef450d84ceb6f334e14c3c98c3fc2f6b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page