cm_poem
古诗样本、填空、押韵和 AI 点评工具。适合在列表、字符串之后做简单互动,也适合文本处理和函数项目阶段做进阶作品。
pip install cm_poem
import cm_poem
poem = cm_poem.random_poem(kind='七言')
print(poem['title'], poem['lines'])
blank = cm_poem.make_blank()
print(blank['question'])
answer = input('请填空:')
if cm_poem.check_answer(answer, blank['answer']):
print('答对了')
else:
print('答案是:', blank['answer'])
print(cm_poem.check_rhyme('黄河入海流', '更上一层楼'))
AI 点评是可选功能,使用时需要学生传入自己的 DeepSeek 或 OpenAI API Key。
import cm_poem
comment = cm_poem.ask_ai_review(
'春风吹过校园路,灯下少年读书声',
api_key='这里填学生自己的 API Key',
provider='deepseek'
)
print(comment)
发布版本不会内置任何 API Key。课堂上建议让学生把 Key 作为函数参数传入,这比设置环境变量更直观。
Metadata
Release files for cm-poem 1.0.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 |
|---|---|---|---|---|
| cm_poem-1.0.1.tar.gz | 5.3 kB | Without provenance | Details for cm_poem-1.0.1.tar.gz |
Release files / cm_poem-1.0.1.tar.gz
| Download URL | cm_poem-1.0.1.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6adc98d8da92952d61097da9cc6644ad5afad107815cc21a72306c561d4118e3
|
|
BLAKE2b-256 checksum How to use checksums |
a4b8ccb9c4a8af9d8415f06b4024c74c2a25f850abb30011000a8515daad84e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Security for cm-poem 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.