Wave 2.B2 / roadmap S5: repeatable paths to import open text into SkyCache packages and the Skybrary works catalog.
Status (v1.5.0 Bulk Open Corpus Ops): unified skybrary corpus doctor/status/batch surface on top of folder, Gutenberg-catalog, OA science, and open-URL importers.
This is not a pirate downloader. SkyCache refuses unknown licenses, blocked hosts, and forbidden markers (warez, commercial decrypt, etc.).
# Readiness (fixtures + license gate + samples)
skycache skybrary corpus doctor --data-dir data
# Local holdings snapshot (packages, licenses, passport gaps)
skycache skybrary corpus status --data-dir data
# Offline demo batch (samples + test fixtures only)
skycache skybrary corpus sample-manifest --out data/corpus-batch-demo.json
skycache skybrary corpus batch \
--manifest data/corpus-batch-demo.json \
--allow-local \
--ingest \
--data-dir data
# Dry-run a real operator catalog later
skycache skybrary corpus batch --manifest my-legal-batch.json --dry-runBatch JSON schema: skycache.corpus.batch.v1 with jobs[] of type
folder | gutenberg_catalog | oa_science | open_url.
Public site: https://skycache.jonbailey.xyz/corpus/
- Confirm the work is open - public domain, CC0, CC-BY / CC-BY-SA, Project Gutenberg license terms, government open access, or operator-authorized pack.
- Never use pirate mirrors - no libgen clones, warez, "free ebook" crack sites, commercial DRM dumps, or Kindle Unlimited rips.
- Prefer primary hosts on the open-fetch allowlist (e.g.
gutenberg.org,archive.orgopen items, Wikimedia, Kiwix). - Pass
--licenseexplicitly - every import command fails closed without it. - Respect robots / site terms - operator-run, rate-limited, no bulk scrape of blocked hosts.
- Record provenance - packages store source path or URL + license in
manifest.json. - Redistribution - you are responsible for local law and license conditions (attribution for CC-BY, etc.).
- Do not claim completeness - bulk import builds a legal subset, not "every book ever written."
Allowed license markers (see skycache/skybrary/license_gate.py):
public domain, cc0, cc-by, cc-by-sa, project gutenberg, operator_supplied, open-access, mit, apache-2.0, ...
Forbidden examples: all rights reserved commercial, piracy, warez, kindle unlimited, decrypt.
Import a directory of files you already legally hold (USB stick, offline dump you prepared yourself, partner MoH pack, etc.).
# Build packages only
skycache skybrary import-folder ./my-open-texts \
--license "public domain" \
--out data/skybrary-build/corpus
# Build + register content catalog + Skybrary FTS
skycache skybrary import-folder ./my-open-texts \
--license "public domain" \
--subjects "literacy,literature_pd" \
--creators "Various (public domain)" \
--ingest \
--data-dir dataSupported suffixes: .txt, .md, .html, .htm, .epub
EPUB is treated as ZIP; plain text is extracted best-effort for FTS; the original .epub is kept in the package when present.
skycache pipeline --plugin corpus_folder_import \
--uri ./my-open-texts \
--option "license=public domain" \
--option language=en \
--data-dir data --simLicense option is required. Missing or forbidden licenses fail closed.
Fetches one URL via the existing open-fetch allowlist (skycache/capabilities/open_fetch.py), then builds a Skybrary package.
# Example pattern only - use a URL you may legally download
skycache skybrary import-open \
"https://www.gutenberg.org/files/XXXX/XXXX-0.txt" \
--license "project gutenberg" \
--title "Example PD work" \
--id open-pg-xxxx \
--ingest \
--data-dir dataRules:
- Host must be on the open allowlist (or operator extra hosts file).
- HTTPS required for remote hosts.
- Still requires
--license(allowlist ≠ automatic redistributable). - Soft size cap (
--max-mb, default 20). - Never point this at pirate mirrors; forbidden URL markers are refused.
Low-level fetch without packaging:
skycache open-fetch "https://www.gutenberg.org/..." --out /tmp/work.txtskycache skybrary search liberty --data-dir data
skycache skybrary doctor --data-dir data
skycache licenses --summary --data-dir data
skycache skybrary pack --profile literacy-1gb --out data/packs/lit --data-dir dataPWA Library tab and /api/skybrary/works use the same FTS catalog.
| Action | Status |
|---|---|
| Scrape pirate ebook sites | Refused |
| Download multi-GB corpora in one shot | Soft caps; operator must batch deliberately |
| Bypass DRM / commercial constellations | Out of scope forever |
| Auto-trust any URL on the internet | Allowlist only |
| Claim a complete world library | Forbidden messaging |
| Path | Role |
|---|---|
skycache/skybrary/corpus_import.py |
Folder + open-URL builders, Skybrary register |
skycache/skybrary/gutenberg_catalog.py |
Batch Gutenberg-style catalog adapter (v0.9) |
skycache/pipelines/plugins/corpus_folder_import.py |
Pipeline plugin |
skycache/skybrary/license_gate.py |
Fail-closed license check |
skycache/capabilities/open_fetch.py |
Allowlisted HTTPS fetch |
Import many works from a local catalog snapshot (JSON/CSV), not an unrestricted scrape.
# Dry-run selection only
skycache skybrary import-gutenberg-catalog \
--catalog ./my-pg-catalog.json \
--max 25 --dry-run
# Sim/CI fixture (local text files, no network)
skycache skybrary import-gutenberg-catalog \
--catalog tests/fixtures/gutenberg/catalog.json \
--allow-local --max 5 --delay 0 \
--out data/skybrary-build/gutenberg --ingest --data-dir data
# Live allowlisted hosts (rate-limited; respect robots/terms)
skycache skybrary import-gutenberg-catalog \
--catalog ./pg-subset.json \
--license "project gutenberg" \
--lang en --max 20 --delay 1.5 \
--out data/skybrary-build/gutenberg --ingestJSON entry shape: id, title, authors, language, subjects, text_url (HTTPS on open-fetch allowlist, or local path with --allow-local).
Rules:
- License still required (default
project gutenberg) - fail closed. - Remote URLs must pass open-fetch allowlist.
- Default delay between fetches; soft caps on max works and total bytes.
- Writes
provenance-gutenberg-batch.jsonunder the out directory. - Never pirate mirrors. Not a complete Gutenberg dump claim.
Capability: skybrary_gutenberg_catalog in skycache capabilities.
See also: legal-ethics.md, legal-pathways-rf-and-content.md, open-sources.md, VISION-SKYBRARY.md.
�ash skycache skybrary import-oa-science --catalog ./oa-catalog.json --dry-run skycache skybrary import-oa-science --catalog tests/fixtures/oa_science/catalog.json --allow-local --ingest --data-dir data
Only rows with open-access / CC / public-domain licenses are imported. Hosts on open-fetch allowlist include arxiv.org, ncbi.nlm.nih.gov, europepmc.org. Never pirate mirrors.