# greek conversion for Python > A library that converts Ancient, Byzantine, and Modern Greek between Greek script, Beta Code, and Latin script, with atomic options composed into standards-based presets, and information-loss diagnostics. **Installation** ```sh pip install greek-conversion ``` The package requires Python 3.11 or later. It is typed: every option key and value is known to editors and type checkers, which complete and check them (`ConversionOptions`, `Preset`, `Format`). **Main functions** | You want to… | Use | | ------------------------------------------------------------------------ | -------------------------------------------- | | Convert a string | `convert(text, source, target, options)` | | Convert many strings at once: the lines of a corpus, a column | `convert_many(texts, source, target, options)` | | Normalize or restyle a string without changing its format | `reencode(text, format, options)` | | …for many strings at once | `reencode_many(texts, format, options)` | | Know whether the conversion loses information, and where each token went | `convert_detailed(text, source, target, options)` | | …for many strings at once | `convert_detailed_many(texts, source, target, options)` | | Convert only the Greek of a text in another language | `convert_greek_passages(text, target, options)` | | Bind a preset, add characters, or restrict the repertoire | `create_converter(configuration)` | Options are given as a mapping, as keyword arguments, or both. Every page of this site is also in Markdown: add `index.md` to its address, as the links below do. ## Start here - [Getting started](https://greek-conversion.humanites.fr/python/guide/getting-started/index.md): Install greek-conversion for Python, convert a first text, set a conversion with options and presets, and convert a corpus in one call. - [How it works](https://greek-conversion.humanites.fr/python/guide/how-it-works/index.md): The three formats, the canonical document, the option groups, and which function to use. - [Glossary](https://greek-conversion.humanites.fr/python/guide/glossary/index.md): The terms this documentation uses for Greek writing, its romanizations, and the library's own notions. ## Your Greek - [Ancient Greek](https://greek-conversion.humanites.fr/python/guide/ancient-greek/index.md): Convert polytonic Greek to and from Beta Code and the scholarly and library romanizations, and know which of them convert back. - [Byzantine and Medieval Greek](https://greek-conversion.humanites.fr/python/guide/byzantine-greek/index.md): Convert Byzantine texts: the conventions that cover the period, breathings written before a capital, the lunate sigma, numerals, uncial-style output, signs for several letters, the overline and the expansion of abbreviations, and punctuation. - [Modern Greek](https://greek-conversion.humanites.fr/python/guide/modern-greek/index.md): Romanize Modern Greek names and texts after ISO 843, ELOT 743, or ALA-LC, read them back, and turn polytonic text into monotonic. ## Standards and presets - [Choosing a preset](https://greek-conversion.humanites.fr/python/guide/presets/index.md): The presets that implement published conventions, what each one loses, and how to refine them. - [Preset reference](https://greek-conversion.humanites.fr/python/reference/presets/index.md): A preset is a named, coherent set of ordinary `ConversionOptions`. - [Preset behavior audit](https://greek-conversion.humanites.fr/python/reference/preset-behavior-audit/index.md): This is a targeted audit of diacritics, punctuation, and numerals beyond the character repertoire audit. - [Preset character repertoire audit](https://greek-conversion.humanites.fr/python/reference/preset-repertoire-audit/index.md): This audit compares the semantic letters built into the engine with the character repertoire supported by each preset's cited references. - [ALA-LC conformance corpus](https://greek-conversion.humanites.fr/python/reference/ala-lc-conformance-corpus/index.md): The executable examples in `tests/ala_lc_conformance_test.ts` are checked against the Library of Congress's published Ancient and Medieval Greek and Modern Greek tables, which the `ala-lc-ancient` and `ala-lc-modern` presets implement. - [BnF, ISO 843, and BGN/PCGN conformance corpus](https://greek-conversion.humanites.fr/python/reference/preset-conformance-corpus/index.md): The spellings in the executable cases in `tests/preset_conformance_test.ts` come from the cited tables and examples. ## Information loss - [What formats and options lose](https://greek-conversion.humanites.fr/python/guide/format-and-option-losses/index.md): Which distinctions each format and each option can lose, which changes are not losses, and where the contract states them. - [Knowing what a conversion loses](https://greek-conversion.humanites.fr/python/guide/losses/index.md): Find out what a conversion cannot keep, and where. ## Recipes - [Diacritics and Unicode output](https://greek-conversion.humanites.fr/python/guide/recipes/diacritics-and-unicode/index.md): Remove all or some diacritics, produce monotonic Greek, and choose how Greek is encoded. - [Transliteration and Beta Code](https://greek-conversion.humanites.fr/python/guide/recipes/transliteration-and-beta-code/index.md): Choose transliteration spellings, restyle a transliteration, and write Beta Code the TLG way. - [Letters and text](https://greek-conversion.humanites.fr/python/guide/recipes/letters-and-text/index.md): Keep or fold letter forms, write the iota on the line, aspirate an elided consonant, normalize case and whitespace, convert the Greek of a text in another language, and build a search key. ## Going further - [The Python package](https://greek-conversion.humanites.fr/python/package/index.md): The Python package runs the TypeScript library in an embedded engine: the same results and versions, Python's names and positions, the engines and their speed, processes, threads, and types. - [Converters, options, and errors](https://greek-conversion.humanites.fr/python/guide/converters/index.md): Check options, prepare them once, make a converter that binds a preset or a repertoire, and use the two together. - [Performance](https://greek-conversion.humanites.fr/python/guide/performance/index.md): How fast the Python package converts on each engine, what a call costs, which engine to choose, and how to keep conversions fast on many short strings, on long texts, and across processes. ## Reference - [Guarantees and limits](https://greek-conversion.humanites.fr/python/reference/guarantees/index.md): This document states what every conversion guarantees, what the library deliberately leaves to the caller, and where each behavior is specified in detail. - [Conversion options](https://greek-conversion.humanites.fr/python/reference/options/index.md): Every conversion function takes the same `ConversionOptions`. - [Greek output](https://greek-conversion.humanites.fr/python/reference/greek-unicode/index.md): Greek accentuation and Unicode representation are independent stages. - [Punctuation and numerals](https://greek-conversion.humanites.fr/python/reference/punctuation-and-numerals/index.md): Greek writes a few signs otherwise than Latin script does, and counts with letters marked by a keraia. - [Information-loss contract](https://greek-conversion.humanites.fr/python/reference/information-loss/index.md): Conversion is defined as parsing a source string into the canonical `Document` model, applying target orthography, and encoding one canonical spelling. - [Conversion-analysis contract](https://greek-conversion.humanites.fr/python/reference/conversion-analysis/index.md): `convert_detailed()` returns the converted text together with an analysis of the information retained by the target representation. - [Character extensions and repertoires](https://greek-conversion.humanites.fr/python/reference/character-extensions/index.md): The built-in conversion functions use a closed, standards-oriented Greek alphabet. - [Stability policy](https://greek-conversion.humanites.fr/python/reference/stability/index.md): The library follows Semantic Versioning. - [API reference](https://greek-conversion.humanites.fr/python/reference/api/index.md): Every function, class, constant, and type of the Python package, from its docstrings. ## TypeScript The library itself, in TypeScript, the reference implementation, has its own documentation: [llms.txt](https://greek-conversion.humanites.fr/llms.txt).