Package: businessowner-retriever
BusinessOwner RetrieverTool to retrieve list of Vietnamese registered business owners.Installpip3 install businessowner-retrieverOn Windows, you candownloadthe prebuilt*.msifile, running it to install.The software is primarily developed and tested on Ubuntu Linux. Windows 10 64-bit is rougly tested and provided installer. I don't have Mac OS X to support.UsageThe command name changes, depending on whether you installed the program.Typical, it isbusinessowner-retrieveron Linux andbusinessowner-retriever.exeon Windows.
If you run from the source, it isbusinessowner_retriever.py.First, you can run the command with "--help" option to see summary of usage:$businessowner-retriever--help
Usage:businessowner-retriever[OPTIONS]COMMAND[ARGS]...

Options:-V,--versionShowtheversionandexit.-v,--verboseShowmorelogtodebug(verbosemode).--helpShowthismessageandexit.

Commands:businessownersGetbusinessownerscodesGetprovince,districtcodesThe program provides two subcommands, which you can also find brief usage guide:$businessowner-retrievercodes--help
Usage:businessowner-retrievercodes[OPTIONS][AREA_CODE]Getprovince,districtcodes

Options:-v,--verboseShowmorelogtodebug(verbosemode).--helpShowthismessageandexit.$businessowner-retrieverbusinessowners--help
Usage:businessowner-retrieverbusinessowners[OPTIONS]AREA_CODEGetbusinessowners

Options:-t,--tax-duty[normal|vat-exempted|suspended|closed|adjusting][default:normal]-o,--outFILENAME[required]-v,--verboseShowmorelogtodebug(verbosemode).--helpShowthismessageandexit.Now are the steps:1. Find province code$businessowner-retrievercodes
┌───────────────────┬──────┐
│Province│Code│
├───────────────────┼──────┤
│AnGiang│805│
│BàRịa-VũngTàu│717│
│BìnhDương│711│
│BìnhPhước│707│
│BìnhThuận│715│
│BìnhĐịnh│507│
│BạcLiêu│821│
│BắcCạn│207│
│BắcGiang│221│
│BắcNinh│223│
│BếnTre│811│
│CaoBằng│203│
│CàMau│823│
│CầnThơ│815│
│GiaLai│603│
│HàGiang│201│
│HàNam│111│
│HàNội│101│
│HàTĩnh│405│
│HòaBình│305│
│HưngYên│109│
│HảiDương│107│
│HảiPhòng│103│
│HậuGiang│816│
│KhánhHòa│511│
│KiênGiang│813│
│KonTum│601│
│LaiChâu│302│
│LongAn│801│
│LàoCai│205│
│LâmĐồng│703│
│LạngSơn│209│
│NamĐịnh│113│
│NghệAn│403│
│NinhBình│117│
│NinhThuận│705│
│PhúThọ│217│
│PhúYên│509│
│QuảngBình│407│
│QuảngNam│503│
│QuảngNgãi│505│
│QuảngNinh│225│
│QuảngTrị│409│
│SócTrăng│819│
│SơnLa│303│
│TPHồChíMinh│701│
│ThanhHoá│401│
│TháiBình│115│
│TháiNguyên│215│
│ThừaThiên-Huế│411│
│TiềnGiang│807│
│TràVinh│817│
│TuyênQuang│211│
│TâyNinh│709│
│VĩnhLong│809│
│VĩnhPhúc│219│
│YênBái│213│
│ĐiệnBiên│301│
│ĐàNẵng│501│
│ĐắcLắc│605│
│ĐắkNông│606│
│ĐồngNai│713│
│ĐồngTháp│803│
└───────────────────┴──────┘2. From the chosen province, lookup ward codeFor example, we want to look into Đắk Nông province.$ businessowner-retriever codes 606
┌──────────────────┬───────┐
│ District         │ Code  │
├──────────────────┼───────┤
│ Huyện Cư Jút     │ 60603 │
│ Huyện Krông Nô   │ 60605 │
│ Huyện Tuy Đức    │ 60617 │
│ Huyện Đắk Glong  │ 60615 │
│ Huyện Đắk Mil    │ 60607 │
│ Huyện Đắk R'Lấp  │ 60611 │
│ Huyện Đắk Song   │ 60609 │
│ Thị xã Gia Nghĩa │ 60613 │
└──────────────────┴───────┘Try Cư Jút district, with code60603:$ businessowner-retriever codes 60603
┌────────────────────┬─────────┐
│ Ward               │ Code    │
├────────────────────┼─────────┤
│ Thị trấn Ea T-Ling │ 6060301 │
│ Xã Cư Knia         │ 6060305 │
│ Xã Ea Pô           │ 6060303 │
│ Xã Nam Dong        │ 6060309 │
│ Xã Trúc Sơn        │ 6060315 │
│ Xã Tâm Thắng       │ 6060313 │
│ Xã Đắk DRông       │ 6060311 │
│ Xã Đắk Wil         │ 6060307 │
└────────────────────┴─────────┘3. Retrieve list of business owners in that wardRunbusinessownerssubcommand, passing ward code, and specify output file name. The program produces data in CSV file.$ businessowner-retriever businessowners 6060305 -o xa_cu_kinia.csv
Wrote to file: xa_cu_knia.csvNotesThe server of data source,www.gdt.gov.vn, has access throttling. After an amount of data retrieval, it will block us. You should take a rest, before continuing, or finding a proxy to fake your IP address.On Windows, please run the program insideConEmu. It is becauseBusinessOwner Retrieverhas an issue with character encoding in PowerShell console, which I (Quân) can't resolve (I'm just a Linux programmer).The produced CSV file is in UTF-8 character encoding but it is not automatically recognized by MS Excel (maybe because of lacking BOM characters). In Excel, you need to do some configuration steps, manually, to make it display correctly the file. If you are tired from that, I recommend to useLibreOffice, which detects CSV better.