You can create your own functions and then call them inside our NoCode table, just like a built-in function. Here is a guide on how to write, deploy and call these functions. Under the hood, we use AWS Lambda at the moment to run our external functions so many of these steps might seem familiar to you.

Code

You can write a function for our platform in python (3.8), nodejs (16.x) and go (1.x).

Priceloop-CLI

The easiest way to deploy our external functions is to use our CLI. Let’s install it via npm:

npm install -g @priceloop/cli

Python

We recommend to create a Python environment first by using virtualenv or conda:

conda create -n my_example python=3.8
source activate my_example

Then create a folder my_example with a file called function.py.

my_example
├── function.py

The function.py should contain something like this:

# event = {'BatchedArgs': [['<col1>', '<col2>'], ['<col1>', '<col2>'], 'Authentication': {'AmazonSellerPartnerRefreshToken': '***'}}
def handler(event, context):
  return list(map(lambda row: "Hello " + row[0], event["BatchedArgs"]))

⚠️ You can also have custom dependencies in your function. Just add a requirements.txt file for your dependencies in the same directory. Our CLI will take care of this as well. If you need to use numpy or pandas, you should use the runtime python_numpy or python_pandas instead of python in the CLI when you are creating the external function.

Now let’s login and then create the function via the CLI: