gutenberg
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "gutenberg" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-056c9883c941db7351fc4af1f5fe25371c602d33c7d5d3c529841ef4fcbdddbe. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/gutenberg-block-pattern-generator before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Create custom WordPress Gutenberg block patterns using register_block_pattern() and the Block Editor API, and organize them into reusable pattern categories with register_block_pattern_category() for effective content library management.
Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Not specified in the source documentation.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- 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.
- Software, accounts and paid services
- Not specified in the source documentation.
- Limits and differences
- Not specified in the source documentation.
- Testing
- Not tested
Browse files
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.
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 提供完整的古腾堡计划电子书搜索、下载和文本提取功能
- 解决用户获取公共领域经典文学作品的实际需求
- 支持多种格式和自动化处理流程
Highlights
- 触发词覆盖全面,包括关键词、网站名称和具体作品名
- 边界清晰,避免与其他技能混淆
- 提供了明确的触发条件说明
Highlights
- 结构完整,包含快速开始、工作原理、CLI参考等完整章节
- 提供了详细的命令行示例和使用说明
- frontmatter元数据完整,包含标签、来源和兼容性信息
Highlights
- 工具来源明确(gutendex API),无需API密钥
- 处理了多种异常情况(超时、格式回退、大小检测)
- 零外部依赖,仅使用Python标准库,提高可靠性
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Accounts, secrets or authorization
Use a dedicated least-privilege account. Keep secrets out of public content and command logs; verify the receiving service and tenant.
Mentioned in main document · lines 15, 52
Domains or addresses referenced in the document
These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.
- gutendex.com
- www.gutenberg.org
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Not specified in the source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.