Skip to content

Commit 945e255

Browse files
committed
docs: update Python guest high-level docs
Some things have changed since the initial implementation.
1 parent c94dc58 commit 945e255

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

guests/python/README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ just release
1414
```
1515

1616
## Python Version
17-
We currently bundle [Python 3.14.0].
17+
We currently bundle [Python 3.14.0], [build for WASI](https://docs.python.org/3/library/intro.html#webassembly-platforms).
1818

1919
## Python Standard Library
2020
In contrast to a normal Python installation there are a few notable public[^public] modules **missing** from the [Python Standard Library]:
@@ -40,7 +40,14 @@ In contrast to a normal Python installation there are a few notable public[^publ
4040
Some modules low level modules like [`os`](https://docs.python.org/3/library/os.html) may not offer all methods, types, and constants.
4141

4242
## Dependencies
43-
We do not bundle any additional libraries at the moment. It is currently NOT possible to install your own dependencies.
43+
Currently we bundle the following libraries:
44+
45+
- [`certifi`] (not really used though, see ["I/O > HTTP"](#http))
46+
- [`charset-normalizer`]
47+
- [`requests`]
48+
- [`urllib3`]
49+
50+
It is currently NOT possible to install your own dependencies.
4451

4552
## Methods
4653
Currently we only support [Scalar UDF]s. One can write it using a simple Python function:
@@ -187,7 +194,18 @@ def compute(x: int) -> int:
187194
```
188195

189196
## I/O
190-
There is NO I/O available that escapes the sandbox. The [Python Standard Library] is mounted as a read-only filesystem.
197+
All I/O operations go through the host, there is no direct interaction with the host operating system.
198+
199+
### Filesystem
200+
The [Python Standard Library] is mounted as a read-only filesystem. The host file system (incl. special paths like `/proc`) are NOT exposed to the guest.
201+
202+
### HTTP
203+
Using [`requests`] or [`urllib3`] you can issue HTTP requests to destinations that are allowed by the host. This is done by [WASI HTTP] and the host is in full control of the HTTP connection including TLS encryption.
204+
205+
Note though that the network functionality included in the [Python Standard Library] -- e.g. [`urllib`] and [`socket`] -- are NOT supported.
206+
207+
### Other
208+
There is NO other I/O available that escapes the sandbox.
191209

192210

193211
[^public]: Modules not starting with a `_`.
@@ -198,6 +216,8 @@ There is NO I/O available that escapes the sandbox. The [Python Standard Library
198216
[`Boolean`]: https://docs.rs/arrow/latest/arrow/datatypes/enum.DataType.html#variant.Boolean
199217
[`bytes`]: https://docs.python.org/3/library/stdtypes.html#bytes
200218
[`Binary`]: https://docs.rs/arrow/latest/arrow/datatypes/enum.DataType.html#variant.Binary
219+
[`certifi`]: https://pypi.org/project/certifi/
220+
[`charset-normalizer`]: https://pypi.org/project/charset-normalizer/
201221
[`date`]: https://docs.python.org/3/library/datetime.html#datetime.date
202222
[`Date32`]: https://docs.rs/arrow/latest/arrow/datatypes/enum.DataType.html#variant.Date32
203223
[`datetime`]: https://docs.python.org/3/library/datetime.html#datetime.datetime
@@ -213,7 +233,12 @@ There is NO I/O available that escapes the sandbox. The [Python Standard Library
213233
[`Microsecond`]: https://docs.rs/arrow/latest/arrow/datatypes/enum.TimeUnit.html#variant.Microsecond
214234
[Python 3.14.0]: https://www.python.org/downloads/release/python-3140
215235
[Python Standard Library]: https://docs.python.org/3/library/index.html
236+
[`requests`]: https://pypi.org/project/requests/
216237
[Scalar UDF]: https://docs.rs/datafusion/latest/datafusion/logical_expr/struct.ScalarUDF.html
238+
[`socket`]: https://docs.python.org/3/library/socket.html
217239
[`str`]: https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str
218240
[`Timestamp`]: https://docs.rs/arrow/latest/arrow/datatypes/enum.DataType.html#variant.Timestamp
241+
[`urllib`]: https://docs.python.org/3/library/urllib.html
242+
[`urllib3`]: https://pypi.org/project/urllib3/
219243
[`Utf8`]: https://docs.rs/arrow/latest/arrow/datatypes/enum.DataType.html#variant.Utf8
244+
[WASI HTTP]: https://github.com/WebAssembly/wasi-http

0 commit comments

Comments
 (0)