Node Inputs

  • Inputs: Define the arguments that you want your Python function to have. Example input could be named ‘location’.
  • Function Body: This is the body of the Python function that you want to run. You can write a Python function here that will execute when the node runs. You can access the ‘Inputs’ through their names within your function. Outputs can be set in this function and will be accessible through Gumloop outputs.
  • Outputs: Define the outputs that you want your Python function to have. An example output could be ‘temperature’. This is the name of the outputs of your Python function which will be returned as values accessible through Gumloop outputs.

Available Libraries

You can import and use a wide range of Python libraries in your function. Here are some categories of libraries that you can import:

  • Data Analysis and Manipulation: pandas, numpy, scipy, xarray
  • Image Processing: opencv-python, imageio, scikit-image
  • Machine Learning: scikit-learn, joblib
  • Natural Language Processing: nltk, textblob, spacy, gensim
  • Web Scraping: beautifulsoup4, requests, urllib3, aiohttp
  • Plotting and Visualization: matplotlib, seaborn, plotly, bokeh
  • File Handling: openpyxl, xlrd, python-docx
  • Audio Processing: librosa, soundfile
  • Testing: pytest
  • Timezone: pytz
  • Web Server: tornado

Full List of Packages:

  • aiohttp
  • beautifulsoup4
  • bokeh
  • exifread
  • gensim
  • imageio
  • joblib
  • librosa
  • matplotlib
  • nltk
  • numpy
  • opencv-python
  • openpyxl
  • pandas
  • pillow
  • playwright
  • plotly
  • praw
  • pytest
  • python-docx
  • pytz
  • replicate
  • requests
  • scikit-image
  • scikit-learn
  • scipy
  • scrapy
  • scrapy-splash
  • seaborn
  • selenium
  • soundfile
  • spacy
  • splinter
  • textblob
  • tornado
  • urllib3
  • xarray
  • xlrd

Node Output

The output of this node will vary based on the user-defined Python function’s returns. Outputs are defined by the user and can consist of any data type or structure the Python function is capable of returning.

Node Functionality

When To Use

This node is incredibly versatile and can be used whenever there’s a need to run arbitrary Python code within a flow. It allows for flexible inputs and outputs, meaning it can be adapted to perform a wide range of tasks that require custom Python code execution. This could be anything from data manipulation, calling external APIs, complex calculations, or conditionally handling information based on inputs provided to the node.

It’s especially useful in scenarios where existing nodes do not meet your requirements, and you need a quick, customizable solution that doesn’t require developing a new node from scratch. Use this node to embed Python scripts that extend the functionality of your flows, making them more powerful and tailored to your specific needs.