中文處理工具,包含中文數轉換、中文翻譯、字元切換、民國日期處理、法規自動完成等
Project description
給懂中文的程式設計師
中文數字模組
運用中文文字處理程式庫的程式設計師自然懂中文, 所以本程式庫設計哲學就是函數以中文命名且能簡明表達功能, 另以簡體名稱表示處理簡體中文情形,繁體名稱表示處理繁體中文情形, 如以中文數字處理功能為例:
from zhongwen.number import 中文數字, 中文数字, 大寫中文數字
中文數字(10600)
>>> '一萬零六百'
中文数字(10600)
>>> '一万零六百'
大寫中文數字(23232.00518)
>>> '貳萬參仟貳佰參拾貳點零零伍壹捌'
民國日期處理
民國日期係目前仍在臺灣地區使用之日期格式, 本模組之【取日期】函數可將民國日期字串轉成日期時間(datetime)類型, 而【民國日期】可將日期時間依指定格式轉成字串,示例如次:
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.14213.tar.gz
(139.8 kB
view details)
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 zhongwen-3.14213.tar.gz.
File metadata
- Download URL: zhongwen-3.14213.tar.gz
- Upload date:
- Size: 139.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0730596435095fa397b9a1779bd89887175b012a35916805edb22abb1f2ce8e6
|
|
| MD5 |
82136e4bd33e5c097cbd2833f97ee135
|
|
| BLAKE2b-256 |
4a88085f3ceff8b33c3f783023f0a7fc5e5373719b6acafe5fa7e29cfab3e3f9
|
File details
Details for the file zhongwen-3.14213-py3-none-any.whl.
File metadata
- Download URL: zhongwen-3.14213-py3-none-any.whl
- Upload date:
- Size: 93.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
395c1581a19b7a068ad74f8572626d0696ff211a16aeab3cdeeb50d2e409b5a0
|
|
| MD5 |
b2c0da763d786051441d87493edd5cc3
|
|
| BLAKE2b-256 |
4755c266637a546c37e205c2365b8b97d660f722f5520e6be1886e08798a02e4
|