Skip to main content

chengyu-cm 四字成语工具库

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

安装

pip install chengyu-cm

使用方法

判断是否是成语

from chengyu_cm import is_chengyu

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

随机抽取一个成语

from chengyu_cm import random_chengyu

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

其他功能

from chengyu_cm import all_chengyu, count

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

数据来源

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

Metadata

Release files for chengyu-cm 1.0.0

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

Source distribution (sdist)

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

Release files / chengyu_cm-1.0.0.tar.gz

Download URL chengyu_cm-1.0.0.tar.gz
Size 185.4 kB
Tags Source
SHA-256 checksum
How to use checksums
039c8cdf33c520d39926242c5eaf55adbe4cae4352c70eeb1719f306f42dc270
BLAKE2b-256 checksum
How to use checksums
71c34d77a3493a456e8dbd23e3bb01c437efde9bb6af2b7239ef0a1e7672e881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for chengyu-cm 1.0.0

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