包含中文的字符串使用拼音比较大小,可用于使用拼音排序字符串等的需求。
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
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file pinyin_order-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: pinyin_order-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45ae7681fb46891de4152ba156cc5da896e4b365da487838716043e97828d915 |
|
MD5 | a0bdb67085409f82de017412cfc2e2be |
|
BLAKE2b-256 | 3cff060512fcf50fdbb506d26ffad4cc9c38cce57e49402603885a3fed94dbcc |