TexOutParse
Simple output/log file parsing library for LaTeX builds.
LaTeX log files are notoriously unstructured and there is a wide variance in the style and content of messages. Messages can be roughly characterised as an error, an warning, a bad box, or info. Packages and classes can also generate messages and, while there are template macros for producing such messages, no structure is enforced on the messages.
Many LaTeX editors provide a log file parser that runs automatically on building the document. A summary of the errors, warnings, and bad boxes is usually displayed to the user. There does not seem to be any library or tool for parsing log files separate from these editors.
Installalation
The library can be installed via Pip
pip install texoutparse
Usage
The main class provided by this library is LaTexLogParser, which is used to parse
the log file and collect the statistics.
from texoutparse import LatexLogParser
parser = LatexLogParser()
with open('sample.log') as f:
parser.process(f)
The parser object contains lists of errors, warnings, and bad boxes, each described by an
LogFileMessage object. Both objects provide a __str__ method that prints a summary of the
error in the case of LatexLogParser and the raw lines in the case of LogFileMessage.
>>> print(parser)
Errors: 1, Warnings: 1, Badboxes:1
>>> print(parser.errors[0])
! Undefined control sequence.
l.6 \dtae
{December 2004}
Contributing
- Fork it. (https://github.com/inakleinbottle/fork)
- Create a feature branch. (
git checkout -b feature/name) - Commit your changes. (
git commit -m 'add some feature') - Push the branch to Github. (
git push origin feature/name) - Create a pull request.
Meta
Sam Morley - inakleinbottle.com - admin@inakleinbottle.com
Distributed under the MIT license. See LICENSE for more information.
Release History
- 1.0. Initial release
Metadata
Release files for texoutparse 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| texoutparse-1.0.0.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| texoutparse-1.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 9.5 kB
Release files / texoutparse-1.0.0.tar.gz
| Download URL | texoutparse-1.0.0.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79bee7f25d14070b4d50ddad53f550d5ce1530a1cc083f98a7119226cf6e3852
|
|
BLAKE2b-256 checksum How to use checksums |
7c9e6be9f1d54b7124ff43c5565d5cee88511c73a3e59f958f3794dc1b9aca21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
|
Release files / texoutparse-1.0.0-py2.py3-none-any.whl
| Download URL | texoutparse-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
094488352f53b3a17169127fe73e62d8591968da65c601507de17f8389e9573c
|
|
BLAKE2b-256 checksum How to use checksums |
777bca530b66acf5a88e3149965d9c2a87012f744cb8a4b19091c7d0aaa26ddd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
|