Decompollaborate / mapfile_parser

Map file parser library focusing decompilation projects
MIT License
17 stars 3 forks source link

[Suggestion]: JSON output for progress #31

Closed mkst closed 1 month ago

mkst commented 1 month ago

Explain the feature

Instead of printing human-readable progress, print some machine readable progress in json

Advantage

can dump it into a badge.json file and use some json querying to make a badge

Disadvantage

No response

Example(s)

--json

AngheloAlf commented 1 month ago

Is something like this what you had in mind?

{
    "all": {
        "decomped": 436452,
        "total": 442904,
        "percentage": 98.5433
    },
    "entry": {
        "decomped": 96,
        "total": 96,
        "percentage": 100.0
    },
    "boot": {
        "decomped": 992,
        "total": 992,
        "percentage": 100.0
    },
    "gzip": {
        "decomped": 7264,
        "total": 7264,
        "percentage": 100.0
    },
    "ultralib": {
        "decomped": 45776,
        "total": 45776,
        "percentage": 100.0
    },
    "libkmc": {
        "decomped": 2480,
        "total": 2480,
        "percentage": 100.0
    },
    "main_segment": {
        "decomped": 345284,
        "total": 351736,
        "percentage": 98.1657
    },
    "libmus": {
        "decomped": 19600,
        "total": 19600,
        "percentage": 100.0
    },
    "rsp": {
        "decomped": 14960,
        "total": 14960,
        "percentage": 100.0
    }
}

As a reference this is how the "normal" version looks like

Category                    : DecompedSize /    Total   OfFolder%  (             OfTotal%)
all                         :       436452 /   442904    98.5433%  ( 98.5433% / 100.0000%)

entry                       :           96 /       96   100.0000%  (  0.0217% /   0.0217%)
boot                        :          992 /      992   100.0000%  (  0.2240% /   0.2240%)
gzip                        :         7264 /     7264   100.0000%  (  1.6401% /   1.6401%)
libultra                    :        45776 /    45776   100.0000%  ( 10.3354% /  10.3354%)
libkmc                      :         2480 /     2480   100.0000%  (  0.5599% /   0.5599%)
main_segment                :       345284 /   351736    98.1657%  ( 77.9591% /  79.4159%)
libmus                      :        19600 /    19600   100.0000%  (  4.4253% /   4.4253%)
rsp                         :        14960 /    14960   100.0000%  (  3.3777% /   3.3777%)
mkst commented 1 month ago

That looks great 👍 should be easy to turn into a badge (or badges) without any further processing!

AngheloAlf commented 1 month ago

Implemented on commit f355b2cccedd25db3355f4abc283b9162024b636