KIPI plugins and Python

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

KIPI plugins and Python

Himanshu Shekhar
Hello

I went through KIPI plugins and had some suggestions.
Currently, KIPI Plugins are written in C++. It's great, fast, but a bit complex, compared to the alternative implementation in Python.

How about reimplementing it in Python? It's easy, scalable.

I had some thoughts to do the same:
* Reimplement the plugins in Python (Python3).

* As it is done currently, other applications using KIPI plugins can use the same API (in C++) to do the image upload/download task, where the C++ helper would spawn some Python subprocess to do the entire task.

* Use some sort of IPC, like File IO to get the response back to the calling program (if required). We can also consider "libpython" as a candidate. https://docs.python.org/3/extending/embedding.html 

Advantages:
* Ease of maintenance, as APIs tend to change fast, and so your callbacks within the program.
* The task is network bound, and not CPU intensive. So, Python is a good choice.
* Python "requests" module is very reliable to handle HTTP requests.
* Objectives can be achieved better with lesser lines of code.
* This could also pave way for creating plugins for other online services and integrating with KDE (like GNOME online accounts).


I would like to have your review on the same. 
If you agree, I can work on some simple prototype by the weekend for a demo.
--

Regards 

Himanshu Shekhar

https://github.com/himanshub16/

Reply | Threaded
Open this post in threaded view
|

Re: KIPI plugins and Python

Gilles Caulier-4
Hi,

I'm very shared to add a new dependency to build plugins. As it's well explained in RedEdit, Python knowledgement will be required to maintain source with C++ and Qt knowledgement. I'm not favorable to increase the complexity. I work personalty to decrease the complexity since a while in this project, where the code become huge for a limited ressource.

Best

Giles Caulier


2017-03-14 9:23 GMT+01:00 Himanshu Shekhar <[hidden email]>:
Hello

I went through KIPI plugins and had some suggestions.
Currently, KIPI Plugins are written in C++. It's great, fast, but a bit complex, compared to the alternative implementation in Python.

How about reimplementing it in Python? It's easy, scalable.

I had some thoughts to do the same:
* Reimplement the plugins in Python (Python3).

* As it is done currently, other applications using KIPI plugins can use the same API (in C++) to do the image upload/download task, where the C++ helper would spawn some Python subprocess to do the entire task.

* Use some sort of IPC, like File IO to get the response back to the calling program (if required). We can also consider "libpython" as a candidate. https://docs.python.org/3/extending/embedding.html 

Advantages:
* Ease of maintenance, as APIs tend to change fast, and so your callbacks within the program.
* The task is network bound, and not CPU intensive. So, Python is a good choice.
* Python "requests" module is very reliable to handle HTTP requests.
* Objectives can be achieved better with lesser lines of code.
* This could also pave way for creating plugins for other online services and integrating with KDE (like GNOME online accounts).


I would like to have your review on the same. 
If you agree, I can work on some simple prototype by the weekend for a demo.
--

Regards 

Himanshu Shekhar

https://github.com/himanshub16/