Skip to main content

cm_chengyu 四字成语工具库

一个简单好用的 Python 四字成语工具库,收录 29502 个四字成语。

安装

pip install cm_chengyu

使用方法

判断是否是成语

from cm_chengyu import is_chengyu

print(is_chengyu('守株待兔'))  # True
print(is_chengyu('你好世界'))  # False

随机抽取一个成语

from cm_chengyu import random_chengyu

print(random_chengyu())  # 随机输出一个四字成语

其他功能

from cm_chengyu import all_chengyu, count

print(count())          # 29502(成语总数)
cylist = all_chengyu()  # 获取所有成语的列表

数据来源

成语数据来自开源项目 chinese-xinhua,经筛选仅保留四字成语。

Metadata

Release files for cm-chengyu 1.0.1

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

Source distribution (sdist)

Source distribution for cm-chengyu 1.0.1
File Size Uploaded Provenance Actions
cm_chengyu-1.0.1.tar.gz 185.4 kB Without provenance Details for cm_chengyu-1.0.1.tar.gz

Release files / cm_chengyu-1.0.1.tar.gz

Download URL cm_chengyu-1.0.1.tar.gz
Size 185.4 kB
Tags Source
SHA-256 checksum
How to use checksums
be3d123f6e1a9fb2f297b695c6c3f08a117ca3ed52b06380be989ce224d4a9d5
BLAKE2b-256 checksum
How to use checksums
5e0d8089cec5385af082246d709c389205ddb654e5e2db33507a443bf01285c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for cm-chengyu 1.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

1.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