Metadata-Version: 2.5
Name: langsci
Version: 0.1.0
Summary: Tools for Language Science Press: LaTeX/BibTeX processing and conversion, catalog and distributor exports, download statistics
Project-URL: Homepage, https://langsci-press.org
Author-email: Sebastian Nordhoff <sebastian.nordhoff@glottotopia.de>
License-Expression: MIT
License-File: LICENSE
Keywords: BibTeX,CLDF,ELAN,LaTeX,interlinear glossed text,linguistics,publishing
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Topic :: Text Processing :: Markup :: LaTeX
Requires-Python: >=3.11
Provides-Extra: all
Requires-Dist: beautifulsoup4; extra == 'all'
Requires-Dist: gitpython; extra == 'all'
Requires-Dist: langdetect; extra == 'all'
Requires-Dist: lxml; extra == 'all'
Requires-Dist: matplotlib; extra == 'all'
Requires-Dist: numpy; extra == 'all'
Requires-Dist: openpyxl; extra == 'all'
Requires-Dist: pillow; extra == 'all'
Requires-Dist: pypdf; extra == 'all'
Requires-Dist: pypdf2<3; extra == 'all'
Requires-Dist: pyyaml; extra == 'all'
Requires-Dist: requests; extra == 'all'
Requires-Dist: wptools; extra == 'all'
Provides-Extra: bod
Requires-Dist: beautifulsoup4; extra == 'bod'
Requires-Dist: pypdf2<3; extra == 'bod'
Requires-Dist: pyyaml; extra == 'bod'
Requires-Dist: requests; extra == 'bod'
Provides-Extra: build
Requires-Dist: pyinstaller; extra == 'build'
Provides-Extra: elan
Requires-Dist: langdetect; extra == 'elan'
Requires-Dist: lxml; extra == 'elan'
Provides-Extra: exports
Requires-Dist: beautifulsoup4; extra == 'exports'
Requires-Dist: openpyxl; extra == 'exports'
Requires-Dist: requests; extra == 'exports'
Provides-Extra: flex
Requires-Dist: lxml; extra == 'flex'
Provides-Extra: git
Requires-Dist: gitpython; extra == 'git'
Provides-Extra: onix
Requires-Dist: lxml; extra == 'onix'
Provides-Extra: online
Requires-Dist: beautifulsoup4; extra == 'online'
Requires-Dist: requests; extra == 'online'
Provides-Extra: proofreading
Requires-Dist: beautifulsoup4; extra == 'proofreading'
Requires-Dist: matplotlib; extra == 'proofreading'
Requires-Dist: numpy; extra == 'proofreading'
Requires-Dist: pypdf; extra == 'proofreading'
Requires-Dist: requests; extra == 'proofreading'
Provides-Extra: release
Requires-Dist: hatch; extra == 'release'
Provides-Extra: sanity
Requires-Dist: pillow; extra == 'sanity'
Provides-Extra: stats
Requires-Dist: matplotlib; extra == 'stats'
Provides-Extra: test
Requires-Dist: beautifulsoup4; extra == 'test'
Requires-Dist: gitpython; extra == 'test'
Requires-Dist: langdetect; extra == 'test'
Requires-Dist: lxml; extra == 'test'
Requires-Dist: matplotlib; extra == 'test'
Requires-Dist: openpyxl; extra == 'test'
Requires-Dist: packaging; extra == 'test'
Requires-Dist: pillow; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: requests; extra == 'test'
Provides-Extra: wikidata
Requires-Dist: requests; extra == 'wikidata'
Requires-Dist: wptools; extra == 'wikidata'
Description-Content-Type: text/markdown

# langsci

Tools for Language Science Press: converting Word/OpenDocument manuscripts to LaTeX, cleaning BibTeX, checking LaTeX sources against the
LangSci guidelines, and the press's own code (catalog and distributor exports, example extraction for CLDF, download statistics).

```sh
python -m venv .venv
.venv/bin/pip install -e ".[sanity,git]"     # from this directory; extras: see below
.venv/bin/doc2tex manuscript.docx             # pandoc (no Java); soffice only for odt/doc
.venv/bin/doc2tex --converter w2l manuscript.odt   # the former converter: w2l (Writer2LaTeX, Java), odt only
.venv/bin/normalizebib localbibliography.bib
```

Python 3.11 or newer. Without extras only the commands `doc2tex` and `normalizebib` and the BibTeX/LaTeX libraries work.

## What is where

| Part | Contents | Extra |
|---|---|---|
| `langsci.bib`, `langsci.latex`, `langsci.conversion`, `langsci.cli` | the core: BibTeX normalising, plain references to BibTeX, LaTeX helpers, the guideline checker, the docx/odt converter, the commands | `sanity` (Pillow) for the checker |
| `langsci.catalog` | the catalog of the press: books, per-book data (CSV), crawler, distributor exports (ONIX, KU, EBSCO, ...), title mapping | `online`, `exports`, `onix` |
| `langsci.services`, `langsci.imtvault`, `langsci.resources` | Zenodo and Glottolog, the interlinear examples for the Lucene/CLDF store, reference lists | `online`, `wikidata` |
| `langsci.downloads` | download statistics: add up the reports (OMP, OAPEN, Zenodo), plots and tables | `stats` |
| `scripts/` | about 30 small scripts of the press, one binary each (`packaging/build_binaries.py`) | see `scripts/README.md` |

## Documentation

| For | Read |
|---|---|
| using the commands, the library, the scripts | [docs/user-guide.md](docs/user-guide.md) |
| converting a manuscript with `doc2tex` (preparing the document, the markers, what is left to do) | [docs/doc2tex-manual.md](docs/doc2tex-manual.md) |
| how the pandoc converter is built (pipeline, filter, limits, tests) | [docs/doc2tex-pandoc-route.md](docs/doc2tex-pandoc-route.md) |
| how the package is organised, where data live, the rules for changing it | [docs/architecture.md](docs/architecture.md) |
| the download statistics (monthly report) | [docs/downloadstats.md](docs/downloadstats.md) |
| the web services (a separate project, `langsci-web`: what they do, installing them on a server, logs) | [web/README.md](web/README.md) |
| the ELAN/FLEx part under the name `eldpy` | [eldpy/README.md](eldpy/README.md) |
| the scripts and their extras | [scripts/README.md](scripts/README.md) |

The top directory is the package `langsci` (`pyproject.toml`, `src/`, `tests/`, `docs/`, `scripts/`, `packaging/`, `tex/`). `eldpy/` and `web/` are two more projects with their own `pyproject.toml` next to it. `history/` is the record of how the code got here (the old code, the findings and decisions of the refactoring): you do not need it to use or change the package; `history/notes/handover.md` is the start if you want it.

## Tests

```sh
.venv/bin/pip install -e ".[test]"
.venv/bin/python -m pytest tests -q          # offline, about a minute; real documents and the network are not needed
```

`w2l`, `bwrap` and `git` make a few more tests run; without them those tests are skipped. The ONIX validity tests need the EDItEUR schemas
(`LANGSCI_ONIX_SCHEMAS=/path`, or `validate_onix --fetch`).

## License

MIT, see `LICENSE`. Publishing on PyPI (`langsci` and `eldpy`, with hatch): [docs/publishing.md](docs/publishing.md).
