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 by Cloud Functions |
|---|---|---|---|---|
| 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.
By default, the python37 and python38 runtimes have a pre-installed SDK library for the Yandex Cloud API. For more info on how to use the SDK, see Using the SDK. You can install the SDK library to other runtime versions by specifying a dependency in requirements.txt.
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 catches 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 execution logging.
To learn more about programming in Python or how certain constructs work, see the official Python documentation