API reference¶
The supported facade modules are listed below, with their public classes and functions generated from the source. These facades are the intended entry points for new code. Lower-level modules may remain importable, but a lower-level path does not become supported merely because Python can import it. The release guard validates the reviewed current facade. For guides, tutorials, and the per-script handbooks, see the project wiki; for what pyaegean is and where to begin, see the home page. The scholarly workflow explains source preservation, optional review, counting choices, and translation evidence.
Where to start¶
aegean: the top-level namespace:open(),load(),read_corpus(),combine(), the core value types, and the subpackages.aegean.core: the script-agnostic model (Corpus,Document,Token,TokenFormState,FormSegment,SourceMarkupRef,Sign, …); build your own withCorpus.from_records, slice withsubset, merge withmerge, search withsearch, export withexport.aegean.search: unified diacritic-insensitive full-text search with lazy SQLite FTS5 sidecar indexes (search_text,search_corpus,fold_greek,fts_index_path,clear_fts_cache).aegean.greek: the Greek NLP pipeline. It covers:- text processing: normalize, tokenize, named sentence policies, scan, tag, lemmatize, and parse;
segment_text()/segment_sentences()with validated plugin results and exact boundary spans, andpipeline_tokens()for typed editorial forms;- isolated
GreekPipelineinstances with serializable configuration, boundediter_analyze_sentences()neural sentence streams, and explicit long-input and runtime-variant selection; - optional typed
TokenConfidence/SentenceConfidenceevidence with the bundled Schema-2 calibration registry (use_calibration_registry()), opt-in weighted top-10 OOV lemma reranking (use_oov_lemma_reranker(config="weighted")), and immutable annotation and domain registries (list_annotation_profiles()/list_domain_profiles()); - exact schema-4
AnalysisReceiptprovenance (runtime registry and evidence, composed output, post-processing, and optional calibration and policy hashes), manifest-validated neural bundles, and lossless CoNLL-U document I/O; - work & collection discovery:
catalog()(1,778 Perseus/First1KGreek works),popular_works(), and the 8 categorized open-licensed Greek library collections (collections(),collection_works(),load_collection(),load_collection_work(),resolve_collection_work()covering 3,844 works across 1,414 authors, 8th c. BCE–1453 CE).
aegean.greek.bible: the Biblical & Koine Greek specialist suite — 9 Greek NT editions with word-level collation (load_nt,nt_books,compare_editions), 13 early 2nd–5th c. CE manuscript witnesses (load_witness,compare_witnesses,expand_nomina_sacra), Extended Strong's & etymological root trees (strongs_entry,search_strongs,strongs_roots), unified word studies & cross-Testament concordance (word_study,search_bible,study_verse), complete 56-book Septuagint (LXX) reader with inline references, Masoretic Psalm numbering, and automatic offline interlinear (load_lxx,enrich_lxx_interlinear,search_lxx,convert_psalm), and 112 patristic commentaries across 11 Church Fathers/traditions (load_commentary,commentary_excerpt).aegean.library: unified resource manager across all 5 bundled corpora, 47 hosted datasets (including the 8 categorized Ancient/Classical/Patristic/Byzantine Greek collections totaling 3,844 works, Patrologia Graeca, Open Apostolic Fathers, Old Testament Pseudepigrapha, 7 Greek epigraphy corpora, DDbDP papyri, Byzantine Vernacular Greek, and Homer Multitext Iliad & scholia), ~1,778 Perseus/First1KGreek literary works, 112 patristic commentaries, lexica, models, and 10 named packs (biblical,church-fathers,patristic,ancient-greek,byzantine-pack,aegean,epigraphy,literary,lexica,neural).aegean.analysis: accounting reconciliation, sign-pattern search, statistics, comparison.aegean.scripts: the built-in writing-system plugins and their public facades for Linear A, Linear B, Cypriot, Cypro-Minoan, and alphabetic Greek.aegean.io: import your own text or token-carrier EpiDoc; export to EpiDoc, CSV, Parquet, RDF Turtle/JSON-LD, editable and risk-prioritized review spreadsheets, and the multi-script Linear A Research Workbench format (to_workbench,to_workbench_bundle,load_workbench_backup). Also exposes complete CoNLL-U envelopes, loss-aware spaCy/Stanza/CLTK adapters, and portable SHA-256-bound interoperability bundles. JSON and SQLite remain the full-fidelity corpus archives.aegean.bundle: portable, deterministic, SHA-256-verified research bundles (create_bundle,inspect_bundle,verify_bundle,extract_bundle,hydrate_bundle) with license-clean NC retrieval pointers, citations, workbench state, review tables, and analysis receipts.aegean.browser: local Greek visual corpus browser server (serve,create_server,BrowserServer) and JSON analysis service, also reachable viaaegean browseand the TUI (v).aegean.db: SQLite round-trip persistence for aCorpus(stdlib-only, queryable rows, FTS5 and optional lexical indexes, lazy streaming, and durable resumable annotation jobs).aegean.dataandaegean.cache: SHA-256-pinned remote dataset store (fetch,list_datasets,remove_dataset,versions) and opt-in analysis memoization cache.aegean.geoandaegean.viz: site coordinates / GeoJSON export and matplotlib/plotly charts.aegean.aiandaegean.translate: provider-agnostic BYOAI clients and lexicon/morphology-grounded translation.aegean.mcp_server: theaegean-mcpModel Context Protocol server (the[mcp]extra).
aegean.io interoperability facade¶
The reviewed public entry points are the typed core envelope (InteropDocument,
InteropTokenMetadata, InteropSentenceMetadata, InteropResult, and
InteropReport), CoNLL-U conversion (from_conllu, to_conllu,
from_token_records, from_ud_document), optional framework adapters
(to_spacy/from_spacy, to_stanza/from_stanza, to_cltk/from_cltk), and
portable InteropBundle helpers (bundle_from_document, dumps_interop_bundle,
loads_interop_bundle, read_interop_bundle, write_interop_bundle), and the
explicit CLTK seam (make_cltk_process). bundle_from_result, the sidecar
codecs, schema constants, and typed interoperability errors are also public and
are listed in the generated aegean.io reference. The adapter
dependencies are lazy and stay outside the core import path.
API policy¶
The facade modules listed here are the supported entry points for new code. The
reviewed list of facade modules and explicitly selected symbols is kept in
scripts/api-manifest.json. Importability alone does not add a new implementation
module to the supported API. python scripts/check_api.py statically verifies
that the reviewed modules and symbols resolve. During pre-1.0 development through
the v4 Greek NLP segment, the facade may change directly when the design improves;
the CHANGELOG, manifest, docs, and tests must describe the resulting current API.
Build a corpus from your own text¶
aegean.io also reads: turn a string, a .txt file, a folder of texts, or a CSV into a
real Corpus with the full filter/query/analyse/export API. Greek text is run through the
Greek tokenizer with punctuation, foreign text, numerals, decoded source text, and
aligned offsets retained; other scripts split on whitespace. Lexical accessors
exclude nonword tokens. token_view="words" opts into the former lossy behavior.
Everything here is offline and stdlib-only.
from aegean import io
corpus = io.from_text("μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος", doc_id="iliad")
print(len(corpus), "document(s),", sum(len(d.words) for d in corpus), "words")
# 1 document(s), 5 words
From the CLI, aegean import writes a corpus you can then analyse like any other:
$ aegean import myplato.txt -o myplato.json # --split whole|paragraph|line
wrote 1 document(s) to myplato.json
$ aegean stats myplato.json --top 5 # …then any corpus command works
Find a work to load¶
greek.catalog() is a bundled, offline index of every work with a Greek (-grc)
edition in Perseus canonical-greekLit + First1KGreek: 1,778 works, far beyond the 25
curated popular_works(). Each entry's id loads directly with greek.load_work
(metadata only: the texts stay fetched-on-demand, never bundled).
from aegean import greek
for w in greek.catalog(author="plato", source="perseus")[:2]:
print(w["id"], "—", w["title"])
# tlg0059.tlg001 — Euthyphro
# tlg0059.tlg002 — Apology
$ aegean greek catalog --author plato --source perseus -n 2
Greek works (36 matches)
┌────────────────┬────────┬───────────┬────────────────────┬─────────┐
│ id │ author │ title │ greek │ src │
├────────────────┼────────┼───────────┼────────────────────┼─────────┤
│ tlg0059.tlg001 │ Plato │ Euthyphro │ Εὐθύφρων │ perseus │
│ tlg0059.tlg002 │ Plato │ Apology │ Ἀπολογία Σωκράτους │ perseus │
└────────────────┴────────┴───────────┴────────────────────┴─────────┘
… and 34 more — narrow with --author/--title, or --limit 0 to list all (-o to save).
pip install pyaegean # core + Linear A + Greek (zero heavy dependencies)
pip install "pyaegean[all]" # bundled runtime extras, including neural (not Parquet/framework adapters)
See the README for the full extras matrix and Benchmarks for the Greek NLP accuracy numbers and protocol.