Skip to content

aegean.library

Unified manager for every corpus, Biblical text bundle, Greek literary work, patristic commentary, lexicon, and neural model supported by pyaegean.

from aegean import library

# Local inventory and pack completion
print(library.summary()["installed_size"])
for pack in library.list_packs():
    print(pack.pack.id, f"{pack.installed_count}/{pack.total_count}")

# Search across all 47 hosted datasets, 3,844 Greek collection works, 1,778 Perseus/First1KGreek works, 112 commentaries, lexica, and models
hits = library.search("Chrysostom", limit=5)

# Install by pack name, alias, dataset ID, work title, TLG/OGC ID, or author:<name>
library.install("biblical")
library.install(["church-fathers", "Iliad"])

# Safely delete downloaded files to reclaim disk space
library.remove("damos")

library

Unified corpus, text, lexicon, and model manager for pyaegean.

Provides one consistent interface across Python, the CLI (aegean library), the interactive REPL, and the TUI for discovering, inspecting, downloading, and removing every resource pyaegean supports:

  • Bundled corpora (5): Linear A, Linear B sample, Cypriot, Cypro-Minoan, Greek sample texts.
  • Downloadable corpora (25): DAMOS Linear B, SigLA Linear A, Greek New Testament (Nestle 1904), Septuagint (LXX), Apostolic Fathers, Pseudepigrapha, John Chrysostom, Early & Late Church Fathers, Patrologia Graeca (33 vols.), Classical/Hellenistic/Imperial/Late-Antique Greek, Byzantine literature & epigraphy, Homer scholia, I.Sicily, IIP, IOSPE, IGCyr/GVCyr, Aphrodisias, Crete, EDH, and DDbDP.
  • Biblical & Koine Greek bundles (5): nt-corpus, nt-editions (8 editions: SBLGNT, SRGNT, BHP, Tischendorf, Westcott-Hort, Byzantine Majority, Patriarchal/Antoniades 1904, Textus Receptus), nt-witnesses (13 early 2nd–5th c. CE uncials and papyri), strongs-greek (11,142 Extended Strong's entries), and lxx-corpus (56 Septuagint books, incl. Ecclesiastes).
  • Greek literary works (~1,778 Perseus/First1K + 3,844 categorized collection works): Perseus canonical-greekLit, First1KGreek, and Open Greek Corpus.
  • Greek patristic commentaries (112): NT Catenae, Origen, Patrologia Graeca biblical commentary volumes, and John Chrysostom homilies.
  • Lexica (5): LSJ, Middle Liddell, Cunliffe, Autenrieth, Abbott-Smith.
  • Models & tables (4): grc-joint, grc-lemma-neural, agdt-derived, grc-paradigms.
  • Named packs (10): biblical, church-fathers, patristic, ancient-greek, byzantine-pack, aegean, epigraphy, literary, lexica, neural for one-command installation of related assets.

No non-stdlib dependencies; lazily exported as aegean.library.

InstallResult dataclass

InstallResult(id: str, title: str, kind: str, status: str, path: str | None = None, bytes: int | None = None, error: str | None = None)

Outcome of installing one item.

LibraryItem dataclass

LibraryItem(id: str, title: str, category: str, kind: str, status: str, bytes: int | None, size_hint: str, license: str, description: str, aliases: tuple[str, ...] = (), tags: tuple[str, ...] = (), asset_name: str | None = None, work_id: str | None = None, open_spec: str | None = None, author: str = '', greek_title: str = '', source: str = '')

One resource managed by :mod:aegean.library.

installed property

installed: bool

Whether this item is currently available offline on disk.

removable property

removable: bool

Whether this item can be deleted from the local store.

LibraryPack dataclass

LibraryPack(id: str, title: str, description: str, items: tuple[str, ...], size_hint: str, aliases: tuple[str, ...] = ())

A named collection of related downloadable items.

PackStatus dataclass

PackStatus(pack: LibraryPack, installed_ids: tuple[str, ...], missing_ids: tuple[str, ...], installed_bytes: int)

Runtime installation status for a :class:LibraryPack.

RemoveResult dataclass

RemoveResult(id: str, title: str, kind: str, status: str, bytes_reclaimed: int = 0, error: str | None = None)

Outcome of removing one item.

format_size

format_size(n: int | None) -> str

Format a byte count as a compact human-readable string.

get_pack

get_pack(name: str) -> LibraryPack | None

Look up a named pack by id or alias (case-insensitive).

list_packs

list_packs(*, root: Path | None = None) -> list[PackStatus]

Return runtime installation status for every named pack.

list_items

list_items(*, category: str | None = None, status: str | None = None, query: str | None = None, include_works: bool = False, limit: int | None = None, root: Path | None = None) -> list[LibraryItem]

List library items with optional category, status, and substring filters.

Parameters

category: One of "corpus", "bible", "work", "commentary", "lexicon", "model", "other" (or None for all). status: "installed" (includes bundled + downloaded), "downloaded" (downloaded only, excluding bundled), "bundled", or "available" (not yet downloaded). query: Case-insensitive substring filter across id, title, author, Greek title, aliases, and description. Passing a query searches across all 1,778+ literary works and commentaries automatically. include_works: When False (default) and category is None and query is empty, includes all corpora, biblical bundles, lexica, models, other datasets, and installed works/commentaries without dumping 1,778 uninstalled works. Set True or pass category="work" to include the full catalogue. limit: Optional maximum number of items to return.

search

search(query: str, *, category: str | None = None, status: str | None = None, limit: int = 50, root: Path | None = None) -> list[LibraryItem]

Search across all corpora, biblical bundles, literary works, commentaries, lexica, and models.

get_item

get_item(identifier: str, *, root: Path | None = None) -> LibraryItem | None

Look up a single library item by canonical id or unambiguous alias.

resolve_targets

resolve_targets(targets: str | Sequence[str], *, root: Path | None = None) -> list[LibraryItem]

Resolve one or more user-friendly target strings to canonical :class:LibraryItems.

Accepts: - pack names/aliases ("biblical", "bible", "epigraphy", "aegean", "lexica", "neural"); - canonical dataset or corpus IDs ("nt-editions", "damos-corpus", "lineara"); - friendly aliases/stems ("editions", "byz", "lxx", "strongs", "witnesses", "damos", "isicily", "lsj"); - CTS TLG work IDs ("tlg0012.tlg001", "tlg4102.tlg001"); - popular or unique work titles ("Iliad", "Odyssey", "Republic"); - "author:<name>" to select all works by an author (e.g. "author:Homer"); - "commentary:<book>" to select all patristic commentary volumes for a book.

Raises LookupError with close suggestions when a target cannot be resolved or is ambiguous.

install

install(targets: str | Sequence[str], *, force: bool = False, progress: Callable[[str], None] | None = None, byte_progress: Callable[[int, int], None] | None = None, abort: Callable[[], bool] | None = None, root: Path | None = None) -> list[InstallResult]

Install one or more packs, datasets, corpora, literary works, or commentaries.

Accepts any target string recognized by :func:resolve_targets. Bundled items and already-installed items (when force=False) are skipped cleanly without hitting the network.

remove

remove(targets: str | Sequence[str] | None = None, *, remove_all: bool = False, root: Path | None = None) -> list[RemoveResult]

Remove downloaded datasets, corpora, works, commentaries, or packs from disk.

Bundled items are never deleted and report status="bundled". When remove_all=True, removes every downloaded dataset and downloaded Greek work/commentary from the local store.

missing_for_corpus

missing_for_corpus(corpus_id: str, *, root: Path | None = None) -> LibraryItem | None

Return the missing :class:LibraryItem required by corpus_id, or None when the corpus is bundled or already downloaded.

missing_for_bible

missing_for_bible(*, tab: str = 'interlinear', edition: str = 'nestle1904', book: str | None = None, ref: str | None = None, root: Path | None = None) -> list[LibraryItem]

Return the missing :class:LibraryItem(s) needed for a Biblical Greek action.

Used by the TUI BiblicalScreen and CLI aegean bible commands to offer one-click / one-command downloads right where a missing text is encountered.

summary

summary(*, root: Path | None = None) -> dict[str, Any]

Return a unified overview of the local library across all categories and packs.