- Quick start for local use
- Documentation index and current status
- Verification for the supported checks and their scope
- Corpus and methods manuscript for the paper and its release record
Software source: 0.7.0. See release changes and the versioned methods contract. The Streamlit Local evidence view exposes recorded recovery status and scoped, read-only corpus search.
Blake builds a reproducible local corpus workflow for William Blake texts, images, metadata, analysis results, visual summaries, exports, and reports. The API is BlakeCorpus.
This is the shared corpus and methods repository. It owns acquisition, source custody, completeness accounting, passage identity, normalization and reusable analysis. Application projects own their questions, query vocabularies, contextual annotations, arguments and manuscripts. The corpus/methods paper here documents this infrastructure; an application's interpretation is not a property of the corpus.
The application contract provides private, hash-bound
portable snapshots and uncapped lexical studies. An application supplies explicit
search forms and receives every category/source-span match, all zero cells and
source denominators. Source roles and authorship labels survive the transfer.
Applications do not need to read an internal SQLite schema or copy search code.
The package imports this surface without loading the optional NLP/vision stack;
the default installation contains only the methods dependencies. Install the full
extra for acquisition, NLP, vision and the corpus pipeline. The narrower
recovery extra supports recovered-source export with HTML parsing and image
verification. See the
shared methods API for explicit retrieval profiles,
counted statistics, proximity, review custody and offline workspaces.
The shared methods have passed bounded source and installed-wheel qualification. The current source adds deterministic review planning and blank, source-bound batches, plus exact interval support. Applications own coordinate frames, grouping, activation and authored decisions. See verification scope and commands for the tested environments and retained limitations. The package-index distribution is independent of the current Git source. The working-paper DOI identifies the deposited manuscript and its exact assets.
The current authoring edition is the 94-page 0.5.0 working draft. Its render-reproduction bundle and reproduction guide preserve the exact native inputs, template pin and distinction between mathematical illustrations and saved corpus diagnostics. This edition retains the stable concept DOI on its cover; its versioned record is Zenodo 23921364. The working-draft record binds the complete independent page/browser review and its remaining limits.
The deposited 94-page 0.5.0 paper is Blake.pdf. Its publication manifest records the reviewed PDF hash, source commit and actual Zenodo record. Archived papers remain accessible at 0.4.0, 0.2.0 and 0.1.0.
The saved-run membership guide and its dated aggregate receipt distinguish current retained evidence from the older unresolved coverage/embedding discrepancy, without publishing provider text or rerunning models.
Current main requires Python 3.11 or newer and pins 3.11.17 for the qualified methods and optional-stack workflows. The current optional profile records modern dependencies and new-analysis admission separately from legacy saved-epoch read/export access. The retained November 2 qualification and its earlier Python 3.15 binary-only refusal remain historical observations, separate from the current profile, Python 3.9 wheels, corpus results and deposits.
uv python pin 3.11.17
uv sync --locked --python 3.11.17 --extra full --extra dev
uv run blake corpus run --quick --output-dir analysis_output
uv run blake corpus run --skip-download --output-dir analysis_output --fixture-mode never --viz-profile core --format json --archive-scope archive-inventory --image-mode archive-all --image-dpi 300 --max-images-per-work none
uv run blake corpus public-release-preflight --output-dir analysis_output --data-dir blake_data
uv run blake corpus public-release-package --output-dir analysis_output --data-dir blake_dataA quick run is offline and uses the local blake_data/ cache. If that cache is empty, quick mode seeds a tiny bundled fixture corpus so the pipeline proves non-empty processing, visualization, export, and reporting without network access. A full run enables live acquisition through registered source providers.
The second command refreshes the existing pipeline store. Publication analysis instead uses a fresh store so captured metadata and earlier results remain intact; see the workflow below. Do not add --skip-analysis when claiming newly computed results.
archive-all is an evidence-depth setting for local Archive image acquisition. It is not a redistribution permission. Public-release preflight and package commands stage metadata, checksums, and release-safe files locally; they do not publish, tag, deposit, or clear rights-gated source materials.
The versioned working paper accompanies the software assets. Its source/copy records, target-ledger entries, image associations and distinct files are separate denominators. Exploratory NLP retains unverified authorship labels. Recoverability of captured bytes does not establish whole-oeuvre completeness or permission to redistribute provider files.
For a fresh reproduction checkout, preserve prior outputs and prepare a new store:
uv run python scripts/prepare_manuscript_epoch.py --destination blake_data/publication/reproduction
uv run python scripts/reproduce_manuscript_analysis.py --data-dir blake_data/publication/reproduction --seed 20261023
uv run python scripts/seal_manuscript_evidence.py --analysis-receipt analysis_output/data/analysis_epoch_receipt.json
uv run python scripts/generate_manuscript_figures.py --public-only
TEMPLATE_REPO_ROOT=../template uv run python scripts/z_generate_manuscript_variables.pyThe seal verifies the existing recovery inventory, backup, private search and retained corruption/repair controls; it does not run another restore drill. These analytical commands require the private corpus and retained backup/control files. The public reproduction archive includes hydrated manuscript sources, aggregate figures and rendering instructions. See the paper workflow.
The saved record analyses retain their actual 0.2.0rc1 producer identity.
Version 0.2.0 supplies corrected membership-bound summaries and covariance
projection, methods profile local-source-evidence-v2, and dashboard schema 2.
The dashboard admits a completed saved epoch only while its bound metadata,
results and transcriptions match. It discloses stale evidence and keeps the
original recovery store separate.
All corpus artifacts are written under analysis_output/ by default:
analysis_output/
├── pipeline_summary.json
├── corpus_manifest.json
├── data/
│ ├── source_discovery.json
│ ├── source_discovery_health.json
│ ├── source_audit.json
│ └── evidence_acquisition_review.json
├── analysis/
│ ├── analysis_summary.json
│ ├── analysis_diagnostics.json
│ └── analysis_results.json
├── visualizations/
│ ├── visualization_summary.json
│ ├── target_coverage_matrix.json
│ ├── target_coverage_matrix.png
│ └── corpus_workbench.html
├── exports/
│ └── export_summary.json
├── reports/
├── completeness_report.json
├── source_coverage.json
├── provenance_manifest.json
├── chronology.json
├── theme_entity_network.json
├── text_image_linkage.json
├── statistics.json
├── private_release_preflight.json
├── private_release_preflight.md
├── public_release_preflight.json
├── public_release_preflight.md
├── rights_gate_report.json
├── rights_gate_report.md
└── corpus_report.md
└── releases/
└── public_release/
├── public_release_manifest.json
├── public_release_bundle.zip
├── CITATION.cff
└── zenodo_metadata.json
Raw downloads, SQLite metadata, cached texts, and images live under blake_data/.
uv sync --extra full --extra dev --extra api --extra gui
uv run python -m blake.recovery_commands recover --full
uv run python -m blake.recovery_commands verify
uv run python -m blake.recovery_commands register
uv run blake-text build-recovered
uv run blake-text --recovered query eternity
uv run blake-text --recovered query state --scope exploratory --plane erdmanRecovery saves the entire pinned blakearchive/data source repository, every
work-copy XML file (including ZIP-delivered variants), and the complete response
from the Archive's Erdman Complete Poetry and Prose reader. Files remain local
under the gitignored blake_data/recovery/ directory. The source archive, extracted
files, per-copy reading texts, all Erdman page records, combined Erdman text,
passage JSONL, and search index have SHA-256 receipts in manifest.json.
The register command makes those source documents available to BlakeCorpus
and the existing pipeline through blake_data/metadata/metadata.db. It preserves
other works and existing recovery analyses. Source documents retain individual
copy identities; the ZIP and XML versions of the same copy remain distinct.
The equivalent commands are blake corpus recover, blake corpus verify-recovery, and blake corpus import-recovery.
Reruns reuse saved sources and verify the prior manifest before updating it.
Use recover --offline --no-images to rebuild from those sources without network
access. Keep each Archive commit in a separate data directory; --commit accepts
only a full commit SHA. The recovery command is executed directly through
blake.recovery_commands; operational failures propagate to its exit status.
--full also retains the complete work, copy, and object API responses and a
pinned snapshot of the full Erdman source edition, including its four XML parts.
Once enabled, that profile is retained on subsequent offline rebuilds. The
Image acquisition tries canonical lowercase and original source spellings;
case exceptions retain their actual source URLs. Source identifiers retain their
original case in the manifest. --image-workers controls concurrency (1–8).
Source recovery, transcription extraction, image recovery, and coverage of
Blake's oeuvre are reported separately. Recovery attempts every identified object
at 300 dpi, then tries an explicitly recorded 100 dpi fallback when necessary.
Resolution counts and fallback object IDs are reported separately. Lower
resolution is never reported as meeting the requested 300 dpi target.
Recovery records each remaining failure for retry. Downloaded images must decode
before being saved. verify checks file hashes, snapshot membership, source
bindings, page and search membership, and the complete image outcome ledger.
Unresolved files are never counted as downloaded. Reviewed transcription rules
are bound to exact source hashes; other ambiguous readings remain explicit errors.
Create a portable local backup after recovery:
uv run python -m blake.recovery_commands backup --destination blake_data/backups/full-corpus.tar
uv run python -m blake.recovery_commands verify-backup blake_data/backups/full-corpus.tar
uv run python -m blake.recovery_commands restore-drill blake_data/backups/full-corpus.tar --destination blake_data/restore-checkThe bundle includes every inventoried source, text, image and index, plus the
exact recovery source code and dependency lockfile. A separate checksum receipt
binds the complete bundle. restore works offline and quarantines conflicting
bytes before restoring them. restore-drill requires an empty destination,
restores every byte, deliberately corrupts a copy, proves verification rejects
the corruption, and restores the original bytes again. It preserves the damaged
control and writes a durable report. Existing backups are preserved; choose a
new destination or use the default content-named path for later snapshots.
MetadataManager.export_metadata also preserves the complete work model,
including all four saved analysis fields. import_metadata validates the full
input array before saving records and stores included text under the destination
corpus. Image paths remain references; use the recovery backup for portable
source and image bytes. Metadata import does not provide a transaction across
the SQLite database and filesystem if an I/O failure interrupts saving.
Primary occurrence search includes only Archive reading layers bound to text works in the existing canonical ledger. Other Archive transcriptions remain unverified. Erdman reading text retains editorial material and stays separate from primary occurrence search. The raw JSON and XML preserve the complete provider response and diplomatic apparatus, including material excluded from the reading layers. An unresolved original reading is reported explicitly; its source file is preserved. A recovered source snapshot establishes the saved inventory, not completeness of every surviving Blake work or edition.
import asyncio
from pathlib import Path
from blake import BlakeCorpus, CorpusConfig
async def main():
corpus = BlakeCorpus(Path("blake_data"), output_dir=Path("analysis_output"))
summary = await corpus.run(CorpusConfig(quick=True))
print(summary.status)
asyncio.run(main())blake corpus run --quick --output-dir analysis_output
blake corpus run --quick --viz-profile full
blake corpus status --coverage
blake corpus visualize --profile core
blake corpus run --format json --format csv --format markdown
blake corpus public-release-preflight --output-dir analysis_output --data-dir blake_data
blake corpus public-release-package --output-dir analysis_output --data-dir blake_data
blake search --query "tyger"
blake info --work-id <id>
blake exploreThe corpus workflow lives under blake corpus; search, info, and explore are convenience commands over local corpus metadata.
analysis_output/corpus_manifest.jsonis the target-ledger coverage contract.analysis_output/data/source_audit.jsonrecords source discovery, provider health, URL checks, Archive metadata enrichment, and missing-evidence candidates.analysis_output/data/evidence_acquisition_review.jsonis the strict review ledger for unresolved targets and manual source leads.analysis_output/analysis/analysis_summary.jsonandanalysis_output/analysis/analysis_diagnostics.jsonrecord current analysis status, eligibility, completion, diagnostics, and errors.output/figures/figure_registry.jsonrecords every manuscript figure, its brief, accessibility notes, statistical question, and generated statistics.analysis_output/reports/private_release_preflight.*andanalysis_output/reports/rights_gate_report.*are local-only release/readiness checks.analysis_output/reports/public_release_preflight.*andanalysis_output/releases/public_release/are the public GitHub + Zenodo release staging surfaces; they generate bundle metadata, checksums, and citation files without altering the repository itself.
blake.corpusownsCorpusConfig,CorpusManifest,CorpusRunSummary,PhaseResult, source registry, andBlakeCorpus.- The corpus manifest compares local works against a versioned canonical target ledger and reports
present,partial,missing,duplicate, andunverifiedcoverage. blake.downloaderkeeps source adapters while corpus acquisition normalizes source records throughSourceProviderwrappers.blake.metadatastores and searches local work metadata.blake.analysiswrites typed analysis records through the corpus pipeline.blake.vizexposes one Pydantic visualization configuration model.blake.exportsupports JSON, CSV, Markdown, HTML, PDF, and Parquet where dependencies permit.
Default source adapters cover Blake Archive, Project Gutenberg, and Internet Archive. Additional museum and discovery adapters exist for British Museum, Tate, Wikimedia, HathiTrust, and related sources. Live-source integration is optional; the default test and quick-run surfaces do not require network access. A run is only reported as complete when the canonical target ledger is fully covered; otherwise reports explain the remaining gaps.
Use blake-text for deterministic passage search with
original spellings, edition/source locators, occurrence counts and explicit
concept expansions. The included demonstration contains seven excerpts from one
1906 edition of The Marriage of Heaven and Hell; it is not the full corpus.
Restored restricted source caches and indexes remain private and untracked.
python -m blake.text_search --index blake_data/search/demo.sqlite build examples/primary-passages.jsonl
python -m blake.text_search --index blake_data/search/demo.sqlite query 'Eternity is in love with the productions of time' --mode phrase
python -m blake.text_search --index blake_data/search/demo.sqlite suiteuv sync --locked --extra full --extra dev --extra api --extra gui
uv run pytest tests/ -q
uv run pytest tests/ -q -m "not slow and not integration"
uv run blake corpus run --quick --output-dir analysis_output
uv run blake corpus run --skip-download --output-dir analysis_output --fixture-mode never --viz-profile core --format json --archive-scope archive-inventory --image-mode archive-all --image-dpi 300 --max-images-per-work none
uv run blake corpus private-release-preflight --output-dir analysis_output --data-dir blake_data
uv run blake corpus public-release-preflight --output-dir analysis_output --data-dir blake_data
uv run blake corpus public-release-package --output-dir analysis_output --data-dir blake_dataText analysis uses locally available NLTK resources. To provision the optional English resources deliberately, run this in the full environment:
uv run python -m nltk.downloader punkt_tab stopwords vader_lexicon averaged_perceptron_tagger_eng maxent_ne_chunker_tab wordsWithout those resources, sentence statistics use punctuation, concordance uses unfiltered word frequencies, and sentiment reports the missing VADER data. Resource provisioning is separate from starting an analysis.
Plain uv sync installs the methods-only dependency set: packaging, Click,
Pydantic and typing extensions. Use uv sync --extra full for the corpus
pipeline. The complete test suite includes GUI tests: install its dependencies
with uv sync --extra full --extra dev --extra gui. GUI/API serving needs its
surface extra (gui or api) together with full.
The project code and project-authored documentation are licensed under the MIT License. See LICENSE.
Downloaded or cached Blake materials under blake_data/, generated image mosaics, source TEI, transcriptions, and provider-supplied images are not relicensed by this repository. Treat them under their source-provider terms and the manifest's recorded authority/license metadata.
The manuscript's legal distribution section and rights-matrix supplement are the release checklist for public artifacts. In short: publish code, commands, checksums, source URLs, manifests, and aggregate diagnostics; keep raw provider files and local evidence caches out of public source releases unless permission, source-compatible licensing, or a venue-specific fair-use rationale is documented.
uv run blake corpus private-release-preflight writes local-only preflight and rights-gate reports under analysis_output/reports/. It never publishes, tags, deposits, or redistributes artifacts; it records what a private GitHub-oriented review would include and which public artifact classes remain blocked.
uv run blake corpus public-release-preflight and uv run blake corpus public-release-package prepare the GitHub + Zenodo release bundle under analysis_output/releases/public_release/. The package includes code, safe generated outputs, CITATION.cff, Zenodo metadata, and SHA-256 checksums while excluding the local manuscript pipeline, raw source caches, and rights-gated assets by default.
Package staging requires a new, unused destination. An existing directory, file
or symlink is refused before preflight writes; it is never deleted or reused.
Choose a new --release-dir for each attempt and retain prior successful and
blocked epochs. Destinations under project sources or captured data, and symlink
parents, are refused. This is local preparation, not an upload or new deposit.
The explicitly selected --output-dir supplies analytical evidence and copied
artifacts; public bundle names remain under analysis_output/ even when that
source epoch lives outside the checkout. Corroboration records bind the selected
manifest's exact bytes using a logical path, size and SHA-256. A matching source
identifier supports contextual target identity only. Pending manual_review
leads remain candidates and cannot make a fallback record ready; the counts do
not claim a second transcription comparison. Unresolved records produce a
blocked report. Rights reports bind the current
docs/manuscript/13_supplement_rights_matrix.md; a missing matrix is explicit
and no old-path fallback or new redistribution permission is inferred.
Operator preflight and staging manifests retain local custody paths and remain
private; only the declared bundle, citation and deposit metadata are publication
assets.
This project is archived on Zenodo with a DOI, cross-linked to this repository:
- DOI: 10.5281/zenodo.23921364
- Zenodo record: working-paper PDF, wheel, source distribution, allowlisted reproduction archive, release manifest and SHA-256 checksums. Provider image mosaics are omitted.
- Earlier paper: 10.5281/zenodo.21047574, whose published record contains the earlier PDF.
- See
CITATION.cfffor citation metadata.
The MIT license covers project code and project-authored outputs only. Provider-supplied Blake Archive TEI, transcriptions, images, and fallback source texts are not included here and remain under their source-provider terms.
| Project | GitHub | Zenodo |
|---|---|---|
| Corpus and shared methods | blake | Paper 0.5.0 |
| Invertebrate readings and concordance | Blakean Entomology | 1.0.0 |
| Political argument and institutional models | Blakean Federalism | 1.0.0 |
Core software 0.7.0 accompanies manuscript 0.5.0. The application
releases keep their qualified SDK pin 263d7c83abe6f1309a64af3285a683c1b7672269;
a later documentation or publication commit does not reassign their producer.
Publication facts bind the selected PDF and assets. Provider corpora remain in private ignored custody.
Publication and reproduction verification records the completed publication and separates immutable release inputs from later documentation and remaining research.