Skip to main content

中文處理工具,包含中文數轉換、中文翻譯、字元切換、民國日期處理、法規自動完成等

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.14214.tar.gz (139.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zhongwen-3.14214-py3-none-any.whl (93.9 kB view details)

Uploaded Python 3

File details

Details for the file zhongwen-3.14214.tar.gz.

File metadata

  • Download URL: zhongwen-3.14214.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

Hashes for zhongwen-3.14214.tar.gz
Algorithm Hash digest
SHA256 8d7c51df3e430fb3e651f8a81b4d4693cd0c25b962ef7a4a4994c712ec24d1d9
MD5 17896caeda336678fae3f1bae2f7d37e
BLAKE2b-256 515a8c1edb43400c771e4b7faaea5ffbfcace0dd49230b2d22c3032a84ff60d1

See more details on using hashes here.

File details

Details for the file zhongwen-3.14214-py3-none-any.whl.

File metadata

  • Download URL: zhongwen-3.14214-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

Hashes for zhongwen-3.14214-py3-none-any.whl
Algorithm Hash digest
SHA256 3338f4fab3a04088989bdbf6717849332203e863d6d778a370e028831eafe51c
MD5 d74e4af73bb53437b325a1868e2df9e6
BLAKE2b-256 a05b9b30f144c5013340dab43dd3a42a480c6fbe0a4fa38bc5df3e6eab87bc0d

See more details on using hashes here.

Supported by

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