We strongly recommend using data components whenever possible. They cover the components required for data applications and are actively maintained.

Additionally, within markdown files, you can use the loadData and postData functions.

You can also use Python scripts built with Morph as APIs. APIs are generated using the alias assigned to the Python function according to the following rules.

Use POST HTTP method.

/cli/run/${alias}/json

You can obtain the DataFrame returned by Python in JSON format. The response is in the following format:

{
  "data": {
    {
      "count": 2,
      "items": [
        {
          "name": "Alice",
          "age": 30
        },
        {
          "name": "Bob",
          "age": 40
        }
      ]
    }
  }
}

/cli/run/${alias}/html

You can obtain the HTML string returned by Python in HTML format. The response is in the following format:

{
  "data": "<div>...</div>"
}

/cli/run/${alias}

You can directly execute the Python function.