Tell me how to build an IronPython library using C # libraries, so that you can use it in native Python afterwards?

Practical goal:

There is a web interface written using flask (nginx + apache2 + debian). I would like to be able to generate xlsx files with native windows libraries (written in C #). T.k. need all the functionality of the format (graphics, formulas, macros, etc.).

Alternative approaches:

Use libraries:

Flask-Excel - the library works directly with the xlsx format

minuses:

  1. very poor toolkit

  2. problem with parsing binary xls

  3. there is no stable version of the library itself and of those from which it is inherited

pyloo - the library uses the libre / open office API.

minuses:

  1. you have to keep the libre / open office process running

PS: if there is any common approach for JPython / Cpython / PyPi, please indicate them as well. I would also like to know the successful practices that you could apply.

Thank you in advance!

    1 answer 1

    1. You need to compile the script in dll using clr.CompileModules in IronPython

    2. To use the resulting dll you need to use the standard python ctypes library ctypes