Skip to main content

Format address using universal pattern

Project description

地址格式規則

https://pypi.org/project/cwaddressformatter/

Release Note

0.1.5: 20231004 修正一些奇怪地址的邏輯

  1. 例如 鳳凰之聲 會被誤判成 鳳凰-聲
  2. 新光三越左營店10樓 被誤判成 新光3越左營店10樓
  3. 移除門號以前的逗號

0.1.2: 20230605 調整邏輯

  1. 更改地址資料庫為郵局版本(2022/07),理論上更準,修正了「中正路四維巷」這種中文巷名的問題。

0.1.0: 20230307 調整邏輯

  1. F改為樓,應用在dash參數上(-x)
  2. 半型改全型()-

0.0.8: 20221202 更新路名OpenData 110版

0.0.5: 20221202 文字轉數字機制優化

  1. 之 改為 -
  2. 文字轉數字機制優化,增加exception時,改用取代的方式將文字轉數字
  3. 移除路名前綴的數字(郵遞區號)
  4. 移除地址中間的空格
  5. 移除typo的疊字

0.0.4: 20200914 根據需求調整

  1. 117號8樓-1==> 全形要改半形
  2. F前是數字才改樓
  3. 之和 - 不轉換

0.0.3: 20200831 修正一些錯誤

  1. 將地址中的F轉成樓,侷限在floor這個參數

0.0.2: 20200831 修正一些錯誤

  1. 村、鄰的數字改為alpha字母
  2. 增加例外判斷,凡是路名分析出來,小於2, 大於7 地址皆不做轉換
  3. 增加郵政信箱判斷

0.0.1: 地址格式規則

  1. 路名包含數字時,十以下已國字表示.例如:工業十路、三多三路;十以上以數字表 示,EX:工業13路

  2. 但路名像是十三北路、四維路、八德路、六張犁路、二十張路則不在上述規則中

  3. X段中的X請一律用國字表示,如忠孝東路三段

  4. 巷、弄、號、樓一律以阿拉伯數字表示,樓不可打F,”之”請以”-“示。 EX:3樓-2

  5. 地址內僅允許存在3種符號:括號 ( )、-、空格,星號、斜線、加號都不行哦!

  6. 國外地址要加國名,避免郵局退件。 EX:(1)中國上海市….、(2)12520 12TH AVE NE SEATTLE WA 98125 USA

  7. 主檔的地址請建在地址1的欄位中即可(不要使用地址2)

  8. 主檔中的台除發票抬頭(ex:臺灣大學)外,統統以“台”表示。

  9. 工業區的話要保留。

  10. 沒有路名的話,要保留里

  11. 樓層後面 建議不處理,或是手動更新後重新處理

  12. 路名參考台灣OpenData提供的地址路名

訂單到ERP後,客服檢查發現地址錯誤 更正地址、找回正確的customerNo,

提供API 更新訂單中的receiver.member <=> Customer 對應資料

套件更新

  1. 更新套件 python3 -m pip install --user --upgrade setuptools wheel

  2. 生成dist python3 setup.py sdist bdist_wheel

  3. 安裝/更新 twine python3 -m pip install --user --upgrade twine

  4. 上傳套件 python3 -m twine upload dist/cwaddressformatter-0.1.5-py3-none-any.whl

參考:https://medium.com/kenny-chang/python-%E7%99%BC%E5%B8%83%E7%AC%AC%E4%B8%80%E5%80%8Bpython%E5%A5%97%E4%BB%B6-gaql-tool-c6c7c357f623

awg5LMXD8QZPGw!

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

cwaddressformatter-0.1.5-py3-none-any.whl (183.0 kB view hashes)

Uploaded Python 3

Supported by

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