中文笔划排序程序
特点
- 支持对名单列表进行按笔划排序
- 支持从文件中读取名单列表
- 支持以便于阅读的方式输出排序后的结果
- 支持将排序后的名单列表写入文件
安装
pip install chinese-stroke-sorting
更新
pip install --upgrade chinese-stroke-sorting
使用说明
>>> # 导入包
>>> from chinese_stroke_sorting import sort_by_stroke, write_sort_result_to_human, \
write_sort_result_to_file, read_name_list_from_file
>>> # 直接对名单列表排序
>>> name_list = ['张三','张二','张一一', '李四', '王五']
>>> print(sort_by_stroke(name_list))
['王五', '李四', '张一一', '张二', '张三']
>>> # 从文件中读取名单列表
>>> name_list_file_path = 'test_name_list.txt'
>>> name_list = read_name_list_from_file(name_list_file_path)
>>> print(name_list)
['张三', '李四', '王五', '赵六', '王一', '王一二']
>>> # 以便于阅读的方式显示排序结果
>>> sort_result = sort_by_stroke(name_list)
>>> result_for_human = write_sort_result_to_human(sort_result, split_char='|')
>>> print(result_for_human)
王一|王一二|王五|李四|张三|赵六
>>> # 将排序结果写入文件
>>> output_file = 'result.txt'
>>> write_sort_result_to_file(sort_result, output_file, split_char='\n')
说明
项目发布于PyPI:单击访问
本模块尚不完善,有任何相关问题或建议,欢迎在本项目的github页面中提交issue: 单击访问
License
GNU General Public License v3.0
Metadata
Release files for chinese-stroke-sorting 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chinese-stroke-sorting-0.3.1.tar.gz | 132.6 kB | Without provenance | Details for chinese-stroke-sorting-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chinese_stroke_sorting-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for chinese_stroke_sorting-0.3.1-py3-none-any.whl |
Total release size: 278.0 kB
Release files / chinese-stroke-sorting-0.3.1.tar.gz
| Download URL | chinese-stroke-sorting-0.3.1.tar.gz |
|---|---|
| Size | 132.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd2e8c8f948cdc3a484ff8480e28c34e660c50fe12d243feff508cac72ed4e8a
|
|
BLAKE2b-256 checksum How to use checksums |
cb8002b3654b914a941356adc9315f2bc74efa3193356296c13f06e42e3b79a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6
|
Release files / chinese_stroke_sorting-0.3.1-py3-none-any.whl
| Download URL | chinese_stroke_sorting-0.3.1-py3-none-any.whl |
|---|---|
| Size | 145.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5be4c9d3bbae80dc17a169767211cf5945f8d77c02ee0b820f418f80461371b0
|
|
BLAKE2b-256 checksum How to use checksums |
7f1d4f751565c150865e8933812900b3b786fdcfd449a05dc8ca529cc10a4daf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.6
|
Security for chinese-stroke-sorting 0.3.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.