Skip to main content

Convert Vietnamese administrative addresses from the old district-based format to the 2025 normalized structure.

Project description

Vietnam Administrative Address Converter Toolkit

Convert Vietnamese administrative addresses from the old province / district / ward structure to the 2025 normalized province / ward structure.

Python PyPI Version Dataset CI


Features

  • Parse free-form Vietnamese addresses in the old administrative format.
  • Convert old province/district/ward references into the new province/ward format.
  • Normalize large CSV datasets in streaming mode.
  • Reuse an in-memory converter with caching for better batch performance.

Package Name

  • PyPI distribution: vietnam-address-converter
  • Python import: vietnam_address_converter
  • CLI command: vietnam-address-converter

Installation

From source

git clone https://github.com/trng28/address-converter.git
cd address-converter

python -m venv .venv

# macOS / Linux
source .venv/bin/activate

# Windows PowerShell
.\.venv\Scripts\Activate.ps1

pip install -e .

From PyPI

pip install vietnam-address-converter

Development-only test dependencies

pip install -r requirements.txt

CLI Usage

Convert one address

vietnam-address-converter --address "Đường Trần Não, Phường Thảo Điền, TP Thủ Đức, Thành phố Hồ Chí Minh"

Run as a module

python -m vietnam_address_converter --address "Đường Trần Não, Phường Thảo Điền, TP Thủ Đức, Thành phố Hồ Chí Minh"

Convert a CSV file

vietnam-address-converter \
  --input-csv data/vietnam_full_address.csv \
  --output-csv data/vietnam_full_address.converted.csv \
  --address-column full_address \
  --cache-size 4096

Output schema:

index,full_address,street,ward,district,city,full_address_new

Python API

from vietnam_address_converter import auto_convert_address, create_converter

result = auto_convert_address(
    "Đường Trần Não, Phường Thảo Điền, TP Thủ Đức, Thành phố Hồ Chí Minh"
)

converter = create_converter()
batch_result = converter.auto_convert_address(
    "Quốc lộ 91C, Xã Đa Phước, Huyện An Phú, Tỉnh An Giang"
)

Dataset

This project uses the public dataset:

Download example:

pip install huggingface_hub
python -c "
from huggingface_hub import hf_hub_download
hf_hub_download(
    repo_id='trucmtnguyen/vietnam-address-collection',
    filename='vietnam_full_address.csv',
    repo_type='dataset',
    local_dir='data/'
)
"

Performance

Validated on 79,931 real addresses from the full dataset.

Performance Summary Conversion Outcomes Remap Rate by Administrative Unit Type Top Provinces by Ward Remap Rate Unresolved Addresses by Province


Project Structure

address-converter/
├── .github/
│   └── workflows/
├── data/
├── docs/
│   └── assets/
├── src/
│   ├── vietnam_address_converter/  # installable Python package
│   ├── batch.py                    # compatibility wrappers for old imports
│   ├── converter.py
│   └── ...
├── tests/
├── pyproject.toml
├── main.py
├── README.md
└── requirements.txt

Release Flow

  • CI runs on every push and pull request.
  • Create a tag like v0.1.0 to trigger the release workflow.
  • Release artifacts include both .whl and .tar.gz.

License

Apache 2.0 © trng28

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

vietnam_address_converter-1.0.5.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

vietnam_address_converter-1.0.5-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file vietnam_address_converter-1.0.5.tar.gz.

File metadata

File hashes

Hashes for vietnam_address_converter-1.0.5.tar.gz
Algorithm Hash digest
SHA256 c4b4ce2e180c4104068733aca63a7986b0ab894a7aa5dd92b08fd4d5ac97762c
MD5 4c97aad21552ff2a83ac3aa897ba7767
BLAKE2b-256 e31c219b214457258606c5d5f9ed05685dd63cc97e6e816e125e5dbd3404e600

See more details on using hashes here.

File details

Details for the file vietnam_address_converter-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for vietnam_address_converter-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c4d18728b0441e41b34967dfd32a11f6b28dde062592a89bd28eaf2a2a822db4
MD5 def3cabecf79635c3279545cc3e254a3
BLAKE2b-256 5525cb8876e726f5c795d2fd72615a5725df0a6ad573b88904a4458c69758374

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