You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Karthick Subramanian <ks...@tnsinc.com> on 2020/03/10 11:53:10 UTC

Nifi - Python SDKs

Hi,

Can anyone point me to any sources or samples on how to use python SDK
(Google Analytics, Facebook etc offers client SDK to access their API)
inside NiFi.

Regards,
K'sub

Re: Nifi - Python SDKs

Posted by Karthick Subramanian <ks...@tnsinc.com>.
Thank you Andy. I will go through the shell script concept via
ExecuteStreamCommand processor So that I can create my python venv and put
my code in a directory and invoke via shell script. So I don't need to
depend on Jython/Nifi JVM for execution.

If I come across any issues, I will post it here.

Regards,
K

On Tue, Mar 10, 2020 at 11:57 AM Andy LoPresto <al...@apache.org> wrote:

> You can use a number of processors to interact with Python. The
> ExecuteScript and InvokeScriptedProcessor components allow you to write
> Python (actually Jython) code and have it be executed by a JSR-223 script
> execution engine within the same NiFi JVM. This allows the script to be
> persisted in the NiFi flow directly and be reusable without external
> dependencies.
>
> You can also use the ExecuteProcess or ExecuteStreamCommand processors to
> invoke shell commands, including calling an external Python script.
>
>
> Andy LoPresto
> alopresto@apache.org
> *alopresto.apache@gmail.com <al...@gmail.com>*
> He/Him
> PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69
>
> On Mar 10, 2020, at 4:53 AM, Karthick Subramanian <ks...@tnsinc.com>
> wrote:
>
> Hi,
>
> Can anyone point me to any sources or samples on how to use python SDK
> (Google Analytics, Facebook etc offers client SDK to access their API)
> inside NiFi.
>
> Regards,
> K'sub
>
>
>

Re: Nifi - Python SDKs

Posted by Andy LoPresto <al...@apache.org>.
You can use a number of processors to interact with Python. The ExecuteScript and InvokeScriptedProcessor components allow you to write Python (actually Jython) code and have it be executed by a JSR-223 script execution engine within the same NiFi JVM. This allows the script to be persisted in the NiFi flow directly and be reusable without external dependencies. 

You can also use the ExecuteProcess or ExecuteStreamCommand processors to invoke shell commands, including calling an external Python script. 


Andy LoPresto
alopresto@apache.org
alopresto.apache@gmail.com
He/Him
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

> On Mar 10, 2020, at 4:53 AM, Karthick Subramanian <ks...@tnsinc.com> wrote:
> 
> Hi,
> 
> Can anyone point me to any sources or samples on how to use python SDK (Google Analytics, Facebook etc offers client SDK to access their API) inside NiFi. 
> 
> Regards,
> K'sub