Annotations
@api

@api

API Decorator

Summary:

The api decorator supports Python cell API functions on the Morph platform. Using this decorator, functions are expected to return .

Functions:

  • Ensures that the output of the function is a JSON object.

Return value:

  • json: Any JSON object.

Usage example:

from typing import Dict
import pandas as pd
from morphdb_utils.api import ref, send_email
from morphdb_utils.annotations import api
 
data = {}
 
@api
def main(data: Dict[str, pd.DataFrame]):
    # write any codes here
    return {
        "message": "ok"
    }

report