Developing in Python. Overview
With Cloud Functions, you can run applications written in Python
This service provides several runtimes with different versions. We do not recommend using runtime versions that are no longer supported.
| Name | Python version | Operating system |
Preloaded | Supported |
|---|---|---|---|---|
| python37 | 3.7.13 | Ubuntu 18.04 | No | No |
| python38 | 3.8.13 | Ubuntu 18.04 | No | No |
| python39 | 3.9.11 | Ubuntu 18.04 | No | No |
| python311 | 3.11.0 | Ubuntu 18.04 | No | No |
| python312 | 3.12.0 | Ubuntu 22.04 LTS | Yes | Yes |
| python314 | 3.14.0 | Ubuntu 22.04 LTS | Yes | Yes |
Note
A function may behave differently in preloaded and standard runtimes. To learn about function behavior, see Preloaded runtime environment.
You can use the SDK library to work with the Yandex Cloud API. To install it, specify the dependency in the requirements.txt file. The SDK library is pre-installed in the python37 and python38 runtimes. For more information, see Using the SDK.
Cloud Functions automatically installs all the specified dependencies required for the function. Dependencies are installed when creating a new function version. For more information, see Managing Python function dependencies.
The runtime automatically loads your code and invokes the request handler you specified. It receives the incoming request and the invocation context as arguments. The context contains additional information about the function parameters.
Cloud Functions automatically captures the application's standard output streams and sends them to the centralized logging system in Yandex Cloud. This system also logs entries about the start and end of each function execution, as well as any errors that occur during execution. For more information about the log format, see Python function runtime logging.
To learn more about programming in Python or using its constructs, see the official Python documentation