ark::python

Classes

  • ark::python::CommsServer
    This is a server used to communicate with the Python process. It is kept as simple as possible to reduce the burden on Python. Previously, we made use of websockets, but the overhead on the Python side was extreme (often 100ms+ to send 20MB of data locally).

    This essentially just establishes a connection and then sends/receives messages that are prefixed with a 2 byte synchronization sequence, a 4 byte length, and then the payload.

  • ark::python::PythonStage
    A stage that supports loading a python-based stage and executing it, as if it a standard C++ stage.

Functions

Declared in “ark/python/path.hh”:

  • std::filesystem::path get_ark_virtualenv_python_path(const std::string & name)
    Returns the virtualenv path, as typically constructed by the Ark build system. The name should be the name of the virtualenv as used with add_python_venv.

    This attempts to return the path in a way that works both when built locally and when running post-deployment.

  • std::filesystem::path get_ark_virtualenv_python_executable(const std::string & name)
    Returns the path to the python3 executable to be used for the given virtualenv, based on the name of the virtualenv. This assumes the path to the virtualenv was built with the Ark build system, and should match the name given with add_python_venv.