DHIS2 Integrations - python vs java

Hello community experts

Recently have observed we are focussing more towards Java based frameworks for integration like using apache camel frameworks

Do we still recommend Python dhis2.py module based scripts for small integration activities?

Can we use python for apache camel framework?

1 Like

@dhis2-backend team would like to seek your advice

1 Like

Hi Jins

You are right that the dhis2 integration team has put quite a bit of effort into the apache camel java integration framework in the hope that it will be useful and that we build up a body of shared experience.

But that doesn’t mean that anybody has to use it or even that other approaches are wrong. Python and nodejs are also two very popular languages for doing integration and we have seen many examples of successful use within the wider community of integrators.

I am not sure about the dhis2.py module. There was a library created by Morten (GitHub - dhis2/dhis2-python: ⛔ [DEPRECATED] Will be replaced by integration-* projects.) which is no longer being maintained. So it might be risky depending too much on that. There is also a module developed by David Huser (GitHub - davidhuser/dhis2.py: Generic and lightweight Python wrapper for the DHIS2 API using requests) which might be more actively maintained.

What I would say is that while small scripts are often the correct solution to a particular problem, there are often complexities involved in integration, for example around error handling, concurrency, performance monitoring, orchestration etc which are not so easy to build in from scratch. This is where having a good integration framework (like camel) comes into its own and starts to deliver benefits.

A python framework which I have seen being used to good effect is Apache Airflow (https://airflow.apache.org/). Its not exactly an integration framework, but works well for this domain. The WAHIT team within WAHO have some good examples of it.

If you have more skills with nodejs you might want to look more at openFn (https://openfn.org). Lots of really exciting stuff happening there.

Sorry that is maybe a long answer to a short question. python scripts are not in any way “wrong”. If you are building more critical integration infrastructure then you might want to consider a more robust framework approach, even with python. We like camel, but there are of course others.

Regards
Bob

3 Likes

Thank you so much @bobj very useful insights. Will explore options like camel, airflow and openfn while I continue to use python for adhoc activities.

1 Like