Available Functions
Search functions...
Function Details
Python Function
Templates using this Function
Brainstorm Meta Titles & Descriptions
Steve Toth's ultimate title tag guide - automated! - SEOnotebook.com
Try it for Free
Listicle Writer
Generate listicle articles (ex. top X tools for Y) for products and services.
Try it for Free
Keyword Cannibalization Analysis
Inspired by Jean-Christophe implementation: https://www.jcchouinard.com/seo-cannibalization-analysis
Try it for Free
This node allows you to run custom Python code.
Outputs
Your return statement should return a string. If you want to return a dictionary, you can use json.dumps(your_data_object)
to convert it to a string. or if you want to return a dataframe, you can use df.to_json(orient='records')
to convert it to a string.
There are a few things to keep in mind when using this node:
1. Using Inputs
While for most nodes we use the {{node_id}} syntax to access the output of a node, in the Python code you can access the inputs from a predefined dictionary called inputs
.
For example:
2. Returning an Output
Only two constraints here:
- Your code must always end with a return statement
- The returned output should always be in string format, even if returning a dictionary
it must be converted to a string using
json.dumps(your_data_object)
or if it's a Pandas dataframe you can use df.to_json(orient='records')
3. Available Imports
In this Runtime environment you have access to the following imports: