Skip to main content

A library for comparing sequential data

Project description

Pyaliner

Library for aligning and visually comparing sequential data in the terminal.

paired 2-way ground-truth vs other comparison

compact

Compact paired target vs output

classic

Classic paired target vs output

inlined ground-truth vs other 2-way comparison

compact

Compact inlined target vs output

classic

Classic inlined target vs output

paired 3-way ground-truth vs other comparison

compact

Compact paired input vs target vs output

classic

Classic paired input vs target vs output

alignment

>>> 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'))

Limitations

  • Three-way alignment uses a slow heuristic.
  • Wide characters, e.g., East Asian scripts, are not properly aligned with narrow ones

Installing

Install with pip:

pip install pyaliner

Testing

Unit tests are written with pytest and hypothesis. Run with:

pip install pytest hypothesis

pytest

Changelog

Check the Changelog for fixes and enhancements of each version.

License

Copyright Jose Llarena 2022

Distributed under the terms of the MIT license, Pyaliner is free and open source software.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyaliner-0.0.1.tar.gz (10.5 kB view hashes)

Uploaded Source

Built Distribution

pyaliner-0.0.1-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page