中文處理工具,包含中文數轉換、中文翻譯、字元切換、民國日期處理、法規自動完成等
Project description
給懂中文的程式設計師
中文數字模組
運用中文文字處理程式庫的程式設計師自然懂中文, 所以本程式庫設計哲學就是函數以中文命名且能簡明表達功能, 另以簡體名稱表示處理簡體中文情形,繁體名稱表示處理繁體中文情形, 如以中文數字處理功能為例:
from zhongwen.number import 中文數字, 中文数字, 大寫中文數字
中文數字(10600)
>>> '一萬零六百'
中文数字(10600)
>>> '一万零六百'
大寫中文數字(23232.00518)
>>> '貳萬參仟貳佰參拾貳點零零伍壹捌'
民國日期處理
處理於臺灣使用之民國日期功能, 示例如次:
from zhongwen.date import 取日期
取日期('111.9.23')
>>> datetime(2022,9,23,0,0)
取日期('110/12/27')
>>> datetime(2021,12,27,0,0)
from zhongwen.date import 民國日期
民國日期(datetime(2021,12,27,0,0), '%Y年%M月%d日')
>>> '110年12月27日'
中文字元判斷
中文字元判斷功能示例如次:
是否為中文字元('繁')
>>> True
是否為中文字元('简')
>>> True
是否為中文字元('a')
>>> False
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zhongwen-3.14206.tar.gz
(139.0 kB
view hashes)
Built Distribution
zhongwen-3.14206-py3-none-any.whl
(93.5 kB
view hashes)
Close
Hashes for zhongwen-3.14206-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b967b55f44e15976cbb5035d3d870edc340b2c29ff8e7478804333c1c6174e4d |
|
MD5 | 4bdc5c0fd6ee19fad9a7e5598d0f348a |
|
BLAKE2b-256 | ac279142506dbb8f6c56a6b05ac982faa5eadf10f974d22e43ec54f687368ed4 |