Library for aligning and visually comparing sequential data in the terminal.
>>> from pyaliner import align, COMPACT
>>> align('Example invalid invalid sentence'.split(), 'Example sentence'.split())
(('Example', 'invalid', 'invalid', 'sentence'), ('Example', '⎵', '⎵', 'sentence'))
>>> align('Example invalid invalid sentence'.split(), 'Example sentence'.split(), kind=COMPACT)
(('Example', 'invalid∙invalid', 'sentence'), ('Example', '⎵', 'sentence'))
- Three-way alignment uses a slow heuristic.
- Wide characters, e.g., East Asian scripts, are not properly aligned with narrow ones
Install with pip:
pip install pyaliner
Unit tests are written with pytest and hypothesis. Run with:
pip install pytest hypothesis
pytest
Check the Changelog for fixes and enhancements of each version.
Copyright Jose Llarena 2022
Distributed under the terms of the MIT license, Pyaliner is free and open source software.