A Wing library for running Python code in inflight.
npm i @winglibs/pythonbringpython;letfunc=newcloud.Function(newpython.InflightFunctionHandler(path: "./test-assets",handler: "main.handler").lift("bucket",bucket,allow: ["get","put"]));test"invokes the function"{letres=func.invoke();}It is also possible to interact with Wing resources through the python code
// main.wletbucket=newcloud.Bucket();letfunc=newcloud.Function(newpython.InflightFunctionHandler(path: "./test-assets",handler: "main.handler").lift("bucket",bucket,allow: ["get","put"]));func.liftClient("bucket",bucket,["get","put"]);# main.pyfromwingimport*defhandler(event, context):
client=lifted("bucket")
client.put("test.txt", "Hello, world!")
return {
"statusCode": 200,
"body": "Hello!"
}cloud.Bucket:get,put
This library is licensed under the MIT License.