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
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.
How to
Replace
difflib.Differ().compare(a, b)
to
bigyo.Bigyo().compare(a, b)
and you get your nice side-by-side comparison.
Bigyo rendering strategy
Default bigyo rendering strategy is SimpleBigyoStrategy
with default params, which will look like this.
- Hello, World |+ Helo, Wold!
? - - |? +
However, you can change separator (defaults to |
) if you wish, by making BigyoStrategy
class with parameter,
bigyo_strat = SimpleBigyoStrategy(sep="*")
...And give it as parameter of Bigyo
.
bigyo_cls = bigyo.Bigyo(bigyo_strategy = bigyo_strat)
In this case, result will look like this.
- Hello, World *+ Helo, Wold!
? - - *? +
Also there exists OnelineBigyoStrategy
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!
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.0.1.tar.gz
.
File metadata
- Download URL: bigyo-0.0.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51c9f0e367b548453d6b7ae2089cd44d60d733c4af2071c28994c5f5964022d4 |
|
MD5 | 9b939bfc5a321ddec897b28d7bb9c99b |
|
BLAKE2b-256 | c6c43a768b28ecc17d3bf955f91bde3f66413571d001bafedc061cafb613f654 |
File details
Details for the file bigyo-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: bigyo-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45aae10ba938e439735762ac0e0368b0a490b4203790f42bf4f0620c349716fe |
|
MD5 | 9f979c017c740184f8801e253c27c66c |
|
BLAKE2b-256 | 98e3688e12e1eb4a7aaf47567228a71752952557f21abdf5f47a018211bd6ee1 |