如何在BlockPy中使用PythonToBlock将python代码包装到块中?

我已经用Python用函数编写了一些类,我想让孩子们使用块编程来尝试我的代码,因此我正在寻找一种可以将类包装成块的工具。

例如,函数foo:

import requests

def foo (url):
  fetch = requests.get(url)
  print(fetch.content.decode())

I came across Blockly and EduBlocks, what they do is converting blocks into Python, and the backend of the blocks are written using JavaScripts. However, both of them cannot do vice versa. Then I found BlockPy, in the README , it says

PythonToBlocks:通过解析Skulpt生成的AST,我们可以构建   等效的块式代码,有效地允许文本之间的往返   和块。

由于BlockPy没有提供完整的文档,因此有人对将功能“ foo”包装到BlockPy中的块中有想法吗?