Add python bindings

From @ubruhin on Wed Feb 21 2018 22:04:53 GMT+0000 (UTC)

So we can script things :slight_smile:

May be related to #2 and #5.

Copied from original issue: https://github.com/LibrePCB/librepcb-rfcs/issues/4

From @ubruhin on Wed Feb 21 2018 22:11:55 GMT+0000 (UTC)

@hephaisto already started with some experiments: https://github.com/hephaisto/LibrePCB/tree/python_bindings

I would like to mention here quick that if this is ever done I recommend to not choose python as an extension language. It is a heavy dependency and awkward to embed into a C or C++ program. A much better choice for example would be Lua which is much smaller, faster, and has a neat and well-designed C interface, of course there are many other options to consider but python is the last I would personally choose.

Thanks for your thoughts @ii8. Probably you’re totally right, just two thoughts from my side:

  • I like the lightness of Lua, but IMHO it is by far not as easy to use/learn as Python :slightly_frowning_face: But maybe there exist other lightweight interpreters which I don’t know yet…
  • We need to distinguish between in-app scripting and standalone scripting. If I understand you correctly you’re talking about in-app scripting. So far I’m not sure if we will ever implement that. However, standalone scripting should be much easier to implement (as no interpreter needs to be embedded) and is useful for many tasks as well (e.g. for our parts generator it would be very helpful). For that, I think Python would be a great choice.