# Goethe Format 1: reference reader

Three Python scripts that read and check Goethe Write projects exactly as the specification of Goethe Format 1
describes them ([`GOETHE_FORMAT_1.md`](../GOETHE_FORMAT_1.md), on the web at https://goethecloud.com/format/).
They need Python 3.9 or later and nothing but its standard library: there is nothing to install.

| File | What it does |
|---|---|
| [`goethe_read.py`](goethe_read.py) | Reads a project package (`.goethe`, or the older `.lexwrite`) or an exchange file (`.goethex`) and prints the outline and the plain text of the manuscript; `--json` gives the same to programs |
| [`check_schema.py`](check_schema.py) | Checks packages, exchange files and single JSON files against the JSON Schemas in [`../schema/`](../schema/project.schema.json); `--strict` also lists keys the schemas do not describe |
| [`test_goethe_read.py`](test_goethe_read.py) | Tests of both scripts and of the schemas |

## Use

```
python3 goethe_read.py "My Novel.goethex"               the outline, then the manuscript's text
python3 goethe_read.py "My Novel.goethe" --outline      only the outline
python3 goethe_read.py "My Novel.goethe" --text --all   the texts of every part, not only the manuscript
python3 goethe_read.py "My Novel.goethex" --json        everything as JSON
python3 check_schema.py "My Novel.goethe" --strict      check against the schemas
python3 test_goethe_read.py                             run the tests
```

`goethe_read.py` ends with exit status 0 when it could read the project, 2 when it refuses the file (it prints the
reason, as section 4.3 of the specification asks), and 1 on any other error. It never writes to the project, never
follows a link and needs no network.

`check_schema.py` and `test_goethe_read.py` expect the schemas in a folder `schema/` beside this folder `reference/`,
as the specification is published. `goethe_read.py` works on its own.

## Licence

Copyright (c) 2026 ICSL FZE. The scripts are licensed under the MIT License; the full text is in [`LICENSE`](LICENSE).
The specification itself is licensed under CC BY 4.0; [`../LICENSE.md`](../LICENSE.md) lists which licence covers which
file. Questions: hello@lexxington.com.
