Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Python object mapping to Talend

Hello,

 I have a class created in Python and would like to pass the instance (object) to Talend. I am not sure as to how to store the object "as-is" and use to retrieve values? Thanks

 

Labels (3)
3 Replies
Anonymous
Not applicable
Author

if you're invoking a talend job from your python script, the simplest way to pass information would be to populate context var's when invoking talend.

you can do this by calling the job and passing an argument for each context variable: --context_param CONTEXT_VAR_NAME=context_var_value
Anonymous
Not applicable
Author

Hello,

  This would be the other way around. In Talend, I am using tSystem to run Python script which is now trying to pass an object ( instance of class) to TSystem Output. However, I am not sure if Python object can be passed as such and how do we store in Talend which is java based. Thanks

Anonymous
Not applicable
Author

There may be a Python interpreter in the Exchange. There are also APIs available that you could use, for example (https://pythonhosted.org/javabridge/java2python.html).

But I would consider serialising (or simply returning) your Python object in XML/JSON and reading that into Talend.