How can i create stroke (like with PencilTool) with python?

Hi. I read all the documentation and i don’t see how i can do it.

Thanks for all the work you are doing! the program is amazing!