gutenberg
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "gutenberg":https://skillpi.com/zh/skills/deepskill-056c9883c941db7351fc4af1f5fe25371c602d33c7d5d3c529841ef4fcbdddbe。安装前核对上游来源和版本:https://skillhub.cn/skills/user_3c6cb52e/gutenberg-block-pattern-generator。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
skillhub.cn
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
使用 register_block_pattern() 和 Block Editor API 创建自定义 WordPress Gutenberg 块模式,并通过 register_block_pattern_category() 建立可复用的模式分类以便对内容库进行有效组织。
介绍来源: third_party · user_3c6cb52e · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- 来源文档未说明。
- 适合谁
- 来源文档未说明。
- 输入和输出
- 翻译待完成,请参阅来源文档。
- 软件、账号及付费要求
- 来源文档未说明。
- 限制与区别
- 来源文档未说明。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: gutenberg
description: >-
Search, download, and extract public-domain books from Project Gutenberg. Look up books
by ID or keyword via gutendex, download plain-text and EPUB editions, strip licensing
boilerplate, extract clean text from EPUB for illustrated works, and classify fiction vs
non-fiction. Ships a portable CLI script with zero external dependencies. Use when the
user says "gutenberg", "public domain", "download a book", "classic literature", "free
ebook", "gutenberg.org", or names any public-domain title or author. Do not use this
skill for unrelated requests; route to the nearest named specialist.
license: MIT
compatibility: Python 3.8+ with zero external dependencies. The CLI uses only the
Python standard library (urllib.request, json, html.parser, zipfile, re, sys). For
EPUB extraction, Python 3.8+ with only stdlib is required (zipfile + html.parser).
The gutendex API (https://gutendex.com) requires no API key or registration. No
env vars needed for basic operation.
metadata:
tags: gutenberg, project-gutenberg, books, public-domain, literature, classics,
ebooks, text-extraction, epub
sources: https://gutendex.com, https://www.gutenberg.org
skills: books, public-domain, literature, text-mining, ebooksGutenberg — Public Domain Book Toolkit
Search, download, and extract clean text from Project Gutenberg — 70,000+ free public-domain ebooks. Ships a portable Python CLI with zero external dependencies.
Quick Start
# Search for books
python3 scripts/gutenberg search "Moby Dick"
# Download by Gutenberg ID (plain text)
python3 scripts/gutenberg download 2701 --format txt
# Download EPUB (for illustrated books)
python3 scripts/gutenberg download 2701 --format epub
# Extract clean text (strips PG boilerplate)
python3 scripts/gutenberg extract 2701
# Classify fiction vs non-fiction
python3 scripts/gutenberg classify 2701
# Full pipeline: search → download → extract
python3 scripts/gutenberg pipeline "Alice's Adventures in Wonderland"
How It Works
Project Gutenberg provides 70,000+ free public-domain ebooks in multiple formats. The gutendex API (https://gutendex.com) offers a free, unauthenticated JSON catalog. No API key required — just curl or this CLI.
Data Flow
User provides title/ID/author
↓
gutendex API search → pick book by ID
↓
Download plain text (preferred) or EPUB (fallback for illustrated books)
↓
Strip PG boilerplate → clean text
↓
Classify fiction/non-fiction → extract content
CLI Reference
search — Find books by keyword
python3 scripts/gutenberg search "Moby Dick"
python3 scripts/gutenberg search "Dracula" --limit 5
python3 scripts/gutenberg search "Sherlock Holmes" --json
python3 scripts/gutenberg search "Alice" --language en
Returns: ID, title, author (with life dates), language, subjects, download count. Results sorted by download count (most popular first).
metadata — Get full metadata for a book by ID
python3 scripts/gutenberg metadata 2701 # Moby Dick
python3 scripts/gutenberg metadata 11 # Alice's Adventures
python3 scripts/gutenberg metadata 1342 # Pride and Prejudice
python3 scripts/gutenberg metadata 1342 --json # JSON-only output
Returns: title, author(s), language(s), subjects, bookshelves, summaries, copyright status, download count, and all available format URLs.
download — Download a book by Gutenberg ID
# Plain text (UTF-8, preferred — works for most books)
python3 scripts/gutenberg download 2701 --format txt
# EPUB with images (for illustrated/scientific books)
python3 scripts/gutenberg download 2701 --format epub
# HTML (alternative fallback)
python3 scripts/gutenberg download 2701 --format html
# Specify output directory
python3 scripts/gutenberg download 2701 --format txt --output ./books/
The file is saved to ./gutenberg-<id>.<ext> (or --output path). Large books may take a moment.
extract — Strip PG boilerplate and produce clean text
python3 scripts/gutenberg extract 2701 # from downloaded txt
python3 scripts/gutenberg extract 2701 --input ./gutenberg-2701.txt
python3 scripts/gutenberg extract 2701 --format epub # extract from EPUB
Output: clean text without the Project Gutenberg license header/footer. For EPUB extraction (illustrated books), extracts text from all XHTML files and merges them into a single cleaned document.
Size detection: if a plain-text download is under 50KB for a known substantial book, warns that the text may be truncated and recommends EPUB mode.
classify — Classify fiction vs non-fiction
python3 scripts/gutenberg classify 2701
python3 scripts/gutenberg classify 2701 --json
Uses the book's subjects and bookshelves to classify:
- Fiction signals: "Fiction", "novels", "short stories", "poetry", "drama", "fantasy", "horror"
- Non-fiction signals: "Essays", "History", "Philosophy", "Biography", "Science", "Religion"
Returns: fiction, non-fiction, or ambiguous (with explanation of why).
pipeline — Full fetch pipeline
python3 scripts/gutenberg pipeline "Moby Dick" # search first
python3 scripts/gutenberg pipeline 2701 # by known ID
python3 scripts/gutenberg pipeline 2701 --clean /tmp/pipeline-output/ # save cleaned text
Runs: search (if title) → metadata → download (txt) → check size → extract (or EPUB fallback) → classify. Prints an executive summary at the end.
Global Flags
| Flag | Effect |
|---|---|
--json |
Output machine-readable JSON instead of human-readable text |
--quiet |
Suppress diagnostic output |
--dry-run |
Show what would be done without executing |
--output ./dir |
Save downloads to a specific directory |
--timeout 30 |
Override API timeout (default 15s) |
Fiction vs Non-Fiction Handling
When the classified result is fiction, the extracted text comes from an authored imagination. Consider splitting analysis into two tracks:
| Track | What it covers | Example claims |
|---|---|---|
| Canon | Facts within the fictional world — named entities, quoted lines, story events, world rules | "In Stoker's text, Dracula can assume wolf, bat, and mist forms" |
| Craft | Real-world technique — how the author achieves effect, publication history, literary influence | "Stoker's epistolary form forces the reader to piece together the narrative like an investigator" |
| Negative space | Deliberate omissions — what the author notably leaves unspecified | "Dracula is never granted interior voice in the novel" |
When classified as non-fiction, claims can be treated as real-world factual assertions about the subject matter.
Known Gotchas
- Plain text truncation for illustrated books — Books with diagrams, figures, or equations (geometry texts, scientific works, art books) may have plain-text downloads silently cut to 5-10KB (just the PG header). Always check file size. Under 50KB for a known substantial book → switch to EPUB extraction. The
pipelinecommand does this check automatically. - Gutendex can be slow or timeout — The API is a free service and can be slow for less popular books. The CLI uses a 15-second default timeout. Use
--timeout 30for slow responses, or navigate directly tohttps://www.gutenberg.org/ebooks/<id>as a fallback. - HTML downloads include navigation markup — HTML downloads contain site navigation and formatting. Prefer plain text or EPUB for clean text extraction.
- Rare books may 404 on certain format URLs — Not every book has every format. The CLI tries UTF-8 plain text first, falls back to US-ASCII, then to the
-0.txtfile path, then to EPUB, then to HTML. Thedownloadcommand reports which format was actually retrieved. - Rate limiting — Gutendex is unauthenticated but rate-limited. Batch requests with
sleep 1between calls for more than 10 rapid-fire requests. - utf-8 vs us-ascii — Gutendex returns both a
text/plain; charset=utf-8and atext/plain; charset=us-asciiURL. Prefer UTF-8; fall back to US-ASCII if the UTF-8 URL returns a 404. - Fiction classification ambiguity — Books with both fiction and non-fiction subjects (e.g. "Historical Fiction" + "History") are marked
ambiguous. Use--jsonto inspect the subject list and decide manually.
References
- scripts/gutenberg — Portable Python CLI. Zero external dependencies (stdlib only). Covers all major Gutenberg workflows: search, download (txt/epub/html), boilerplate stripping, EPUB text extraction, fiction classification, and the full pipeline.
- references/epub-extraction.md — EPUB text extraction details for illustrated books, with expanded Python walkthrough and format detection tips.
- Project Gutenberg — 70,000+ free ebooks.
- Gutendex API — JSON web API for the Project Gutenberg catalog.
当前收录版本
1.0.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供完整的古腾堡计划电子书搜索、下载和文本提取功能
- 解决用户获取公共领域经典文学作品的实际需求
- 支持多种格式和自动化处理流程
亮点
- 触发词覆盖全面,包括关键词、网站名称和具体作品名
- 边界清晰,避免与其他技能混淆
- 提供了明确的触发条件说明
亮点
- 结构完整,包含快速开始、工作原理、CLI参考等完整章节
- 提供了详细的命令行示例和使用说明
- frontmatter元数据完整,包含标签、来源和兼容性信息
亮点
- 工具来源明确(gutendex API),无需API密钥
- 处理了多种异常情况(超时、格式回退、大小检测)
- 零外部依赖,仅使用Python标准库,提高可靠性
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
账号、密钥或授权
使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。
主文档提及 · 第 15, 52 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- gutendex.com
- www.gutenberg.org
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
来源文档未说明。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。