Skip to main content

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', '🏀🐔🏀']

Metadata

Release files for pinyin-order 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pinyin-order 0.0.1
File Interpreter ABI Platform
pinyin_order-0.0.1-py3-none-any.whl Python 3 none any Details

Release files / pinyin_order-0.0.1-py3-none-any.whl

Download URL pinyin_order-0.0.1-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45ae7681fb46891de4152ba156cc5da896e4b365da487838716043e97828d915
BLAKE2b-256 checksum
How to use checksums
3cff060512fcf50fdbb506d26ffad4cc9c38cce57e49402603885a3fed94dbcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Security for pinyin-order 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page