brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
gutenbergSearch, 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…
Independent GitHub snapshot · Automated classification · Original documentation governs
Search, download, and extract clean text from Project Gutenberg — 70,000+ free public-domain ebooks. Ships a portable Python CLI with zero external dependencies.
# 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"
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.
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
search — Find books by keywordpython3 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 IDpython3 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 textpython3 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-fictionpython3 scripts/gutenberg classify 2701
python3 scripts/gutenberg classify 2701 --json
Uses the book's subjects and bookshelves to classify:
Returns: fiction, non-fiction, or ambiguous (with explanation of why).
pipeline — Full fetch pipelinepython3 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.
| 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) |
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.
pipeline command does this check automatically.--timeout 30 for slow responses, or navigate directly to https://www.gutenberg.org/ebooks/<id> as a fallback.-0.txt file path, then to EPUB, then to HTML. The download command reports which format was actually retrieved.sleep 1 between calls for more than 10 rapid-fire requests.text/plain; charset=utf-8 and a text/plain; charset=us-ascii URL. Prefer UTF-8; fall back to US-ASCII if the UTF-8 URL returns a 404.ambiguous. Use --json to inspect the subject list and decide manually.