AllSpiceIO / py-allspice

An AllSpice-API wrapper in Python
MIT License
0 stars 0 forks source link

Simple BOM post-processing #154

Open shrik450 opened 2 days ago

shrik450 commented 2 days ago

There are a wide variety of operations that users might want to perform on the BOM rows/columns after they have been generated. Right now, the only way to do this is to generate the BOM via generate_bom and use python. Even that approach has a few issues:

If possible, we should at least support:

shrik450 commented 2 days ago

One idea I've had regarding this is that this could be part of the columns dict we accept. For example:

    columns = {
        "Part Number": {
            "attributes": ["Part", "MFN Part#"],
            "sort": "desc",
            "remove_matching": "TESTPOINT",
        },
        "Designator": {
            "attribute": "Designator",
            "sort": "asc",
            "grouped_values_sort": "asc",
            "grouped_values_separator": ", ",
        },
    }

The plugin can then use YAML to convert into this format.

Note that this can be done in a fully backwards-compatible way in py-allspice and the plugin by checking the types.