Skip to content

Commit 77f0e5c

Browse files
chore: update README (#12)
1 parent 47bfbcc commit 77f0e5c

File tree

1 file changed

+49
-5
lines changed

1 file changed

+49
-5
lines changed

README.md

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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

88
This 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

0 commit comments

Comments
 (0)