Skip to main content

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

Downloads (Badge for me :D)

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!

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

bigyo-0.1.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

bigyo-0.1.2-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file bigyo-0.1.2.tar.gz.

File metadata

  • Download URL: bigyo-0.1.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for bigyo-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1d9ac94c8f162c99d3c819571ead570a24805a1c43e00dde1974e43ed30509e7
MD5 bd9c1465266f0d1413072fc47216e856
BLAKE2b-256 cf9955703293aa339de771a663ac6ff56987eadb89e2f7b4a25f073bac4555a9

See more details on using hashes here.

File details

Details for the file bigyo-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: bigyo-0.1.2-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.10.4

File hashes

Hashes for bigyo-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d4ef0f1fcfa4dd21f1894d755814c331d99e8b8f6be639ad6670b997c17988bd
MD5 85f4a521a2b950d0cfc4e5466e427567
BLAKE2b-256 8db1b86016d6435ebb28c622b0da9850a7d461d36edb5fc6f704596ffb182453

See more details on using hashes here.

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