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.
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.
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.0to trigger the release workflow. - Release artifacts include both
.whland.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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vietnam_address_converter-1.0.3.tar.gz.
File metadata
- Download URL: vietnam_address_converter-1.0.3.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ac0dd101f55ca65098d4c31203dda5d9054f577a1f984f9ceddd301b01e57d8
|
|
| MD5 |
025f0e8f6a1edf715c07e7e00cdbaf3c
|
|
| BLAKE2b-256 |
95a37c14a0846674c90debc3084f71862a935f00e257e24cc4f45a7567fc2b7c
|
File details
Details for the file vietnam_address_converter-1.0.3-py3-none-any.whl.
File metadata
- Download URL: vietnam_address_converter-1.0.3-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01f857c8cac5105378cf654acb94d5f811622cbd65947c8104f14ad294ca9785
|
|
| MD5 |
071d8631f639fe2d575965c79ed09af2
|
|
| BLAKE2b-256 |
b66ed88d183fd206acd993233ca636eec5d9b8150294b1e5600658e8309fd0ac
|