Python library for side-by-side diff in terminal, use difflib as its engine. Supports beautiful output with multi-width or zero-width character.
Project description
bigyo
Bigyo (비교(KR): Comparison) is simple python library for side-by-side diff in terminal.
Use difflib as its engine.
Supports beautiful output with multi-width or zero-width character.
Install
pip install bigyo
It just works!
How to
Replace
difflib.Differ().compare(a, b)
to
bigyo.Bigyo().compare(a, b)
and you get your nice side-by-side comparison generator. (Note it is generator)
Also, to get full comparison string at once, there is
bigyo.Bigyo().comparison_string(a, b)
method for you to use.
Bigyo rendering strategy
Default bigyo rendering strategy is SimpleBigyoRenderer
with default params, which will look like this.
- Hello, World |+ Helo, Wold!
? - - |? +
However, you can change separator (defaults to |
) if you wish, by making BigyoRenderer
class with parameter,
bigyo_rd = SimpleBigyoRenderer(sep="*")
...And give it as parameter of Bigyo
.
bigyo_cls = bigyo.Bigyo(bigyo_renderer = bigyo_rd)
In this case, result will look like this.
- Hello, World *+ Helo, Wold!
? - - *? +
Also there exists OnelineBigyoRenderer
which will render difference like this.
He>l<lo, Wo>r<ld|Helo, Wold<!>
History
All the commits can be found in github page.
0.0.1 2022.12.15 Project init!
0.1.0 2022.12.17 Added comparison_string method, changed name from BigyoStrategy to BigyoRenderer, bugfix
0.1.1 2022.12.17 Separate bigyo_renderer, change directory structure
0.1.2 2022.12.21 Now with sphinx document!
0.1.3 2022.12.21 Requirements.txt had typo.
0.1.4 2022.12.27 Documentation fixs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bigyo-0.1.4.tar.gz
.
File metadata
- Download URL: bigyo-0.1.4.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dba8e6e7eb2e08ab9034e8fe263cbec6b46a66c100305c9615ce81d17cabe74 |
|
MD5 | 126f26f899117664bd3a6ada9475e39a |
|
BLAKE2b-256 | 5e26f13570dd72866973e420b5a8e1a9b33091d48dd44a15a269abbbf51cd8cd |
File details
Details for the file bigyo-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: bigyo-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d3abb4729f831ae83ecfff1e53f6a08beaae523ac59cda8f5600f67cb0d9dd4 |
|
MD5 | fb0e93bc9f004453d9a6f04119141da9 |
|
BLAKE2b-256 | a8f8700175891f03ad6e9a01ca15d5473687bc2554c2d9de5060a25dc1d5f515 |