File tree Expand file tree Collapse file tree 1 file changed +49
-5
lines changed
Expand file tree Collapse file tree 1 file changed +49
-5
lines changed Original file line number Diff line number Diff line change 11# Deno Sandbox Python SDK
22
3- Create isolated [ sandboxes on Deno Deploy ] ( https://deno.com/deploy/sandboxes ) to
4- securely run code in a lightweight Linux microVM. You can securely run shell
5- scripts, spawn processes, execute JavaScript applications and REPLs, and
6- interact with files remotely.
3+ Create isolated [ Deno sandboxes ] ( https://deno.com/deploy/sandboxes ) to run code
4+ in a lightweight Linux microVM. You can securely run shell scripts, spawn
5+ processes, execute JavaScript applications and REPLs, and interact with files
6+ remotely.
77
88This Python SDK let's you create and manage sandboxes programmatically.
99
@@ -15,7 +15,51 @@ uv add deno-sandbox
1515
1616## Quick Start
1717
18- TODO
18+ Sync:
19+
20+ ``` py
21+ from deno_sandbox import DenoDeploy
22+
23+ def main ()
24+ sdk = DenoDeploy()
25+
26+ with sdk.sandbox.create() as sb
27+ child_process = sb.spawn({
28+ " command" : " npx" ,
29+ " args" : [
30+ " cowsay" ,
31+ " hello"
32+ ]
33+ })
34+
35+ await p.status
36+
37+ if __name__ == " __main__"
38+ main()
39+ ```
40+
41+ Async:
42+
43+ ``` py
44+ from deno_sandbox import AsyncDenoDeploy
45+
46+ async def main ()
47+ sdk = AsyncDenoDeploy()
48+
49+ async with sdk.sandbox.create() as sb
50+ child_process = await sb.spawn({
51+ " command" : " npx" ,
52+ " args" : [
53+ " cowsay" ,
54+ " hello"
55+ ]
56+ })
57+
58+ await p.status
59+
60+ if __name__ == " __main__"
61+ asyncio.run(main())
62+ ```
1963
2064## License
2165
You can’t perform that action at this time.
0 commit comments