Expansion modules

Are there any plans to support expansion modules in LibrePCB? Functions like BOM can be implemented with python so that the end user could easily customize these functions without needing a new tool revision.

Generally this is planned, but it doesn’t have high priority and requires high efforts so probably I can’t implement it in the near future.

See also Add ability to load plugins at runtime and Add python bindings.

1 Like

Urban,

You wouldn’t implement it. I’m suggesting that we develop a collection of python scripts that run outside of librePCB and could be easily modified by the end user. You could add a menu pick to launch these scripts but even that is optional.

@ouabache for a script to be able to run, it needs access to the data that it wants to read or modify. This means that LibrePCB needs to provide an API for these scripts (e.g. the Python bindings).

If on the other hand you mean that a script should just run on the files without any API provided by LibrePCB: Well, that’s already possible now! You can just launch a script outside of LibrePCB and pass in the path to a LibrePCB project, and it could try to generate a BOM in a specific format, for example.

That’s what I mean. I want read only access to LibrePCB files to generate things like a BOM or netlist/nodelist etc. This would improve the usefulness of LibrePCB without taking any of Urban’s time.

I could do this myself in perl but I think python would be a better choice so I am now trying to teach myself python. I could use any help anyone can offer creating routines that can parse LibrePCB files

Of course you can parse the project files with a script, but then the script obviously accesses the saved state of a project, not the current (possibly modified) state in the editor. In addition, the scripts also have to take care of supporting older file formats - if they don’t, it wouldn’t work reliable for long term. For these reasons I don’t like to integrate any menu item or so to call custom scripts - IMHO the user experience would be too bad.

I agree such scripts are totally fine for personal use since as the creator of such scripts you fully understand these limitations and are able to handle them. So there’s nothing wrong with creating such scripts for personal use.

However, for official extension support I only want to provide something which works exactly as expected by the user: Accessing the current (unsaved) state of a project, and seamless & reliable support for older file formats. This is only possible when implementing an official, stable API into LibrePCB. Such an API would allow users to write extensions & scripts (even headless scripts outside of the LibrePCB application) without needing to worry about low level file format things.