Skip to main content

包含中文的字符串使用拼音比较大小,可用于使用拼音排序字符串等的需求。

Project description

pinyin-order

包含中文的字符串使用拼音比较大小,可用于使用拼音排序字符串等的需求。

from pinyin_order import PinyinOrderStr, pinyin_sorted


result1 = PinyinOrderStr('汉字和English') == PinyinOrderStr('汉子和english')  # True
result2 = PinyinOrderStr('汉字') > PinyinOrderStr('hanzi')  # True
result3 = PinyinOrderStr('abc啊') <= PinyinOrderStr('ABC哦')  # True

strings = ['a哦', 'a啊', '汉字', '这是abc', '者时ABC', '123', 'abc', '漢字', '🏀🐔🏀', ' ']
result4 = pinyin_sorted(strings)
# [' ', '123', 'abc', 'a啊', 'a哦', '汉字', '漢字', '这是abc', '者时ABC', '🏀🐔🏀']

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

pinyin_order-0.0.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file pinyin_order-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pinyin_order-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 45ae7681fb46891de4152ba156cc5da896e4b365da487838716043e97828d915
MD5 a0bdb67085409f82de017412cfc2e2be
BLAKE2b-256 3cff060512fcf50fdbb506d26ffad4cc9c38cce57e49402603885a3fed94dbcc

See more details on using hashes here.

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