Skip to content
module

rsconnect.actions

Public API for managing settings and deploying content.

Functions
  • are_apis_supported_on_server(connect_details) Returns whether or not the Connect server has Python itself enabled and its license allows for API usage. This controls whether APIs may be deployed..</>
  • check_server_capabilities(connect_server, capability_functions, details_source) Uses a sequence of functions that check for capabilities in a Connect server. The server settings data is retrieved by the gather_server_details() function.</>
  • cli_feedback(label) Context manager for OK/ERROR feedback from the CLI.</>
  • create_api_deployment_bundle(directory, extra_files, excludes, entry_point, app_mode, environment, extra_files_need_validating) Create an in-memory bundle, ready to deploy.</>
  • create_api_manifest_and_environment_file(directory, entry_point, environment, app_mode, extra_files, excludes, force) Creates and writes a manifest.json file for the given Python API entry point. If the related environment file (requirements.txt, environment.yml, etc.) doesn't exist (or force is set to True), the environment file will also be written.</>
  • create_notebook_deployment_bundle(file_name, extra_files, app_mode, python, environment, extra_files_need_validating, hide_all_input, hide_tagged_input) Create an in-memory bundle, ready to deploy.</>
  • create_notebook_manifest_and_environment_file(entry_point_file, environment, app_mode, extra_files, force, hide_all_input, hide_tagged_input) Creates and writes a manifest.json file for the given notebook entry point file. If the related environment file (requirements.txt, environment.yml, etc.) doesn't exist (or force is set to True), the environment file will also be written.</>
  • deploy_bokeh_app(connect_server, directory, extra_files, excludes, entry_point, new, app_id, title, python, conda_mode, force_generate, log_callback) A function to deploy a Python Bokeh app module to Connect. Depending on the files involved and network latency, this may take a bit of time.</>
  • deploy_bundle(connect_server, app_id, name, title, title_is_default, bundle) Deploys the specified bundle.</>
  • deploy_by_manifest(connect_server, manifest_file_name, new, app_id, title, log_callback) A function to deploy a Jupyter notebook to Connect. Depending on the files involved and network latency, this may take a bit of time.</>
  • deploy_dash_app(connect_server, directory, extra_files, excludes, entry_point, new, app_id, title, python, conda_mode, force_generate, log_callback) A function to deploy a Python Dash app module to Connect. Depending on the files involved and network latency, this may take a bit of time.</>
  • deploy_jupyter_notebook(connect_server, file_name, extra_files, new, app_id, title, static, python, conda_mode, force_generate, log_callback, hide_all_input, hide_tagged_input) A function to deploy a Jupyter notebook to Connect. Depending on the files involved and network latency, this may take a bit of time.</>
  • deploy_python_api(connect_server, directory, extra_files, excludes, entry_point, new, app_id, title, python, conda_mode, force_generate, log_callback) A function to deploy a Python WSGi API module to Connect. Depending on the files involved and network latency, this may take a bit of time.</>
  • deploy_python_fastapi(connect_server, directory, extra_files, excludes, entry_point, new, app_id, title, python, conda_mode, force_generate, log_callback) A function to deploy a Python ASGI API module to RStudio Connect. Depending on the files involved and network latency, this may take a bit of time.</>
  • deploy_streamlit_app(connect_server, directory, extra_files, excludes, entry_point, new, app_id, title, python, conda_mode, force_generate, log_callback) A function to deploy a Python Streamlit app module to Connect. Depending on the files involved and network latency, this may take a bit of time.</>
  • describe_manifest(file_name) Determine the entry point and/or primary file from the given manifest file. If no entry point is recorded in the manifest, then None will be returned for that. The same is true for the primary document. None will be returned for both if the file doesn't exist or doesn't look like a manifest file.</>
  • fake_module_file_from_directory(directory) Takes a directory and invents a properly named file that though possibly fake, can be used for other name/title derivation.</>
  • gather_basic_deployment_info_for_notebook(connect_server, app_store, file_name, new, app_id, title, static) Helps to gather the necessary info for performing a deployment.</>
  • gather_basic_deployment_info_from_manifest(connect_server, app_store, file_name, new, app_id, title) Helps to gather the necessary info for performing a deployment.</>
  • gather_server_details(connect_server) Builds a dictionary containing the version of RStudio Connect that is running and the versions of Python installed there.</>
  • get_python_env_info(file_name, python, conda_mode, force_generate) Gathers the python and environment information relating to the specified file with an eye to deploy it.</>
  • inspect_environment(python, directory, conda_mode, force_generate, check_output) Run the environment inspector using the specified python binary.</>
  • is_conda_supported_on_server(connect_details) Returns whether or not conda is supported on a Connect server.</>
  • set_verbosity(verbose) Set the verbosity level based on a passed flag</>
  • spool_deployment_log(connect_server, app, log_callback) Helper for spooling the deployment log for an app.</>
  • test_api_key(connect_server) Test that an API Key may be used to authenticate with the given RStudio Connect server. If the API key verifies, we return the username of the associated user.</>
  • test_server(connect_server) Test whether the given server can be reached and is running Connect. The server may be provided with or without a scheme. If a scheme is omitted, the server will be tested with both https and http until one of them works.</>
  • validate_entry_point(entry_point, directory) Validates the entry point specified by the user, expanding as necessary. If the user specifies nothing, a module of "app" is assumed. If the user specifies a module only, the object is assumed to be the same name as the module.</>
  • validate_extra_files(directory, extra_files) If the user specified a list of extra files, validate that they all exist and are beneath the given directory and, if so, return a list of them made relative to that directory.</>
  • validate_file_is_notebook(file_name) Validate that the given file is a Jupyter Notebook. If it isn't, an exception is thrown. A file must exist and have the '.ipynb' extension.</>
  • validate_manifest_file(file_or_directory) Validates that the name given represents either an existing manifest.json file or a directory that contains one. If not, an exception is raised.</>
  • which_python(python, env) Determine which python binary should be used.</>
  • write_api_manifest_json(directory, entry_point, environment, app_mode, extra_files, excludes) Creates and writes a manifest.json file for the given entry point file. If the application mode is not provided, an attempt will be made to resolve one based on the extension portion of the entry point file.</>
  • write_environment_file(environment, directory) Writes the environment file (requirements.txt, environment.yml, etc.) to the specified directory.</>
  • write_notebook_manifest_json(entry_point_file, environment, app_mode, extra_files, hide_all_input, hide_tagged_input) Creates and writes a manifest.json file for the given entry point file. If the application mode is not provided, an attempt will be made to resolve one based on the extension portion of the entry point file.</>
generator

rsconnect.actions.cli_feedback(label)

Context manager for OK/ERROR feedback from the CLI.

If the enclosed block succeeds, OK will be emitted. If it fails, ERROR will be emitted. Errors will also be classified as operational errors (prefixed with 'Error') vs. internal errors (prefixed with 'Internal Error'). In verbose mode, tracebacks will be emitted for internal errors.

function

rsconnect.actions.set_verbosity(verbose)

Set the verbosity level based on a passed flag

:param verbose: boolean specifying verbose or not

function

rsconnect.actions.which_python(python, env=environ({'PATH': '/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'HOSTNAME': 'cefa3a44761f', 'PYTHONPATH': '/rsconnect_python', 'VERSION': '1.6.0', 'LANG': 'C.UTF-8', 'GPG_KEY': 'E3FF2839C048B25C084DEBE9B26995E310250568', 'PYTHON_VERSION': '3.8.11', 'PYTHON_PIP_VERSION': '21.2.4', 'PYTHON_GET_PIP_URL': 'https://github.com/pypa/get-pip/raw/c20b0cfd643cd4a19246ccf204e2997af70f6b21/public/get-pip.py', 'PYTHON_GET_PIP_SHA256': 'fa6f3fb93cce234cd4e8dd2beb54a51ab9c247653b52855a48dd44e6b21ff28b', 'LC_ALL': 'C.UTF-8', 'HOME': '/'}))

Determine which python binary should be used.

In priority order: * --python specified on the command line * RETICULATE_PYTHON defined in the environment * the python binary running this script

function

rsconnect.actions.inspect_environment(python, directory, conda_mode=False, force_generate=False, check_output=<function check_output at 0x7fcd9e3dd3a0>)

Run the environment inspector using the specified python binary.

Returns a dictionary of information about the environment, or containing an "error" field if an error occurred.

function

rsconnect.actions.test_server(connect_server)

Test whether the given server can be reached and is running Connect. The server may be provided with or without a scheme. If a scheme is omitted, the server will be tested with both https and http until one of them works.

:param connect_server: the Connect server information. :return: a second server object with any scheme expansions applied and the server settings from the server.

function

rsconnect.actions.test_api_key(connect_server)

Test that an API Key may be used to authenticate with the given RStudio Connect server. If the API key verifies, we return the username of the associated user.

:param connect_server: the Connect server information. :return: the username of the user to whom the API key belongs.

function

rsconnect.actions.gather_server_details(connect_server)

Builds a dictionary containing the version of RStudio Connect that is running and the versions of Python installed there.

:param connect_server: the Connect server information. :return: a three-entry dictionary. The key 'connect' will refer to the version of Connect that was found. The key python will refer to a sequence of version strings for all the versions of Python that are installed. The key conda will refer to data about whether Connect is configured to support Conda environments.

function

rsconnect.actions.are_apis_supported_on_server(connect_details)

Returns whether or not the Connect server has Python itself enabled and its license allows for API usage. This controls whether APIs may be deployed..

:param connect_details: details about a Connect server as returned by gather_server_details() :return: boolean True if the Connect server supports Python APIs or not or False if not. :error: The RStudio Connect server does not allow for Python APIs.

function

rsconnect.actions.is_conda_supported_on_server(connect_details)

Returns whether or not conda is supported on a Connect server.

:param connect_details: details about a Connect server as returned by gather_server_details() :return: boolean True if supported, False otherwise :error: Conda is not supported on the target server. Try deploying without requesting Conda.

function

rsconnect.actions.check_server_capabilities(connect_server, capability_functions, details_source=<function gather_server_details at 0x7fcd9da57040>)

Uses a sequence of functions that check for capabilities in a Connect server. The server settings data is retrieved by the gather_server_details() function.

Each function provided must accept one dictionary argument which will be the server settings data returned by the gather_server_details() function. That function must return a boolean value. It must also contain a docstring which itself must contain an ":error:" tag as the last thing in the docstring. If the function returns False, an exception is raised with the function's ":error:" text as its message.

:param connect_server: the information needed to interact with the Connect server. :param capability_functions: a sequence of functions that will be called. :param details_source: the source for obtaining server details, gather_server_details(), by default.

function

rsconnect.actions.validate_file_is_notebook(file_name)

Validate that the given file is a Jupyter Notebook. If it isn't, an exception is thrown. A file must exist and have the '.ipynb' extension.

:param file_name: the name of the file to validate.

function

rsconnect.actions.validate_extra_files(directory, extra_files)

If the user specified a list of extra files, validate that they all exist and are beneath the given directory and, if so, return a list of them made relative to that directory.

:param directory: the directory that the extra files must be relative to. :param extra_files: the list of extra files to qualify and validate. :return: the extra files qualified by the directory.

function

rsconnect.actions.validate_manifest_file(file_or_directory)

Validates that the name given represents either an existing manifest.json file or a directory that contains one. If not, an exception is raised.

:param file_or_directory: the name of the manifest file or directory that contains it. :return: the real path to the manifest file.

function

rsconnect.actions.validate_entry_point(entry_point, directory)

Validates the entry point specified by the user, expanding as necessary. If the user specifies nothing, a module of "app" is assumed. If the user specifies a module only, the object is assumed to be the same name as the module.

:param entry_point: the entry point as specified by the user. :return: the fully expanded and validated entry point and the module file name..

function

rsconnect.actions.deploy_jupyter_notebook(connect_server, file_name, extra_files, new=False, app_id=None, title=None, static=False, python=None, conda_mode=False, force_generate=False, log_callback=None, hide_all_input=False, hide_tagged_input=False)

A function to deploy a Jupyter notebook to Connect. Depending on the files involved and network latency, this may take a bit of time.

:param connect_server: the Connect server information. :param file_name: the Jupyter notebook file to deploy. :param extra_files: any extra files that should be included in the deploy. :param new: a flag to force this as a new deploy. :param app_id: the ID of an existing application to deploy new files for. :param title: an optional title for the deploy. If this is not provided, ne will be generated. :param static: a flag noting whether the notebook should be deployed as a static HTML page or as a render-able document with sources. :param python: the optional name of a Python executable. :param conda_mode: use conda to build an environment.yml instead of conda, when conda is not supported on RStudio Connect (version<=1.8.0). :param force_generate: force generating "requirements.txt" or "environment.yml", even if it already exists. :param log_callback: the callback to use to write the log to. If this is None (the default) the lines from the deployment log will be returned as a sequence. If a log callback is provided, then None will be returned for the log lines part of the return tuple. :param hide_all_input: if True, will hide all input cells when rendering output :param hide_tagged_input: If True, will hide input code cells with the 'hide_input' tag when rendering output :return: the ultimate URL where the deployed app may be accessed and the sequence of log lines. The log lines value will be None if a log callback was provided.

function

rsconnect.actions.fake_module_file_from_directory(directory)

Takes a directory and invents a properly named file that though possibly fake, can be used for other name/title derivation.

:param directory: the directory to start with. :return: the directory plus the (potentially) fake module file.

function

rsconnect.actions.deploy_python_api(connect_server, directory, extra_files, excludes, entry_point, new=False, app_id=None, title=None, python=None, conda_mode=False, force_generate=False, log_callback=None)

A function to deploy a Python WSGi API module to Connect. Depending on the files involved and network latency, this may take a bit of time.

:param connect_server: the Connect server information. :param directory: the app directory to deploy. :param extra_files: any extra files that should be included in the deploy. :param excludes: a sequence of glob patterns that will exclude matched files. :param entry_point: the module/executable object for the WSGi framework. :param new: a flag to force this as a new deploy. :param app_id: the ID of an existing application to deploy new files for. :param title: an optional title for the deploy. If this is not provided, ne will be generated. :param python: the optional name of a Python executable. :param conda_mode: use conda to build an environment.yml instead of conda, when conda is not supported on RStudio Connect (version<=1.8.0). :param force_generate: force generating "requirements.txt" or "environment.yml", even if it already exists. :param log_callback: the callback to use to write the log to. If this is None (the default) the lines from the deployment log will be returned as a sequence. If a log callback is provided, then None will be returned for the log lines part of the return tuple. :return: the ultimate URL where the deployed app may be accessed and the sequence of log lines. The log lines value will be None if a log callback was provided.

function

rsconnect.actions.deploy_python_fastapi(connect_server, directory, extra_files, excludes, entry_point, new=False, app_id=None, title=None, python=None, conda_mode=False, force_generate=False, log_callback=None)

A function to deploy a Python ASGI API module to RStudio Connect. Depending on the files involved and network latency, this may take a bit of time.

:param connect_server: the Connect server information.
:param directory: the app directory to deploy.
:param extra_files: any extra files that should be included in the deploy.
:param excludes: a sequence of glob patterns that will exclude matched files.
:param entry_point: the module/executable object for the WSGi framework.
:param new: a flag to force this as a new deploy.
:param app_id: the ID of an existing application to deploy new files for.
:param title: an optional title for the deploy.  If this is not provided, ne will
be generated.
:param python: the optional name of a Python executable.
:param conda_mode: use conda to build an environment.yml
instead of conda, when conda is not supported on RStudio Connect (version<=1.8.0).
:param force_generate: force generating "requirements.txt" or "environment.yml",
even if it already exists.
:param log_callback: the callback to use to write the log to.  If this is None
(the default) the lines from the deployment log will be returned as a sequence.
If a log callback is provided, then None will be returned for the log lines part
of the return tuple.
:return: the ultimate URL where the deployed app may be accessed and the sequence
of log lines.  The log lines value will be None if a log callback was provided.
function

rsconnect.actions.deploy_dash_app(connect_server, directory, extra_files, excludes, entry_point, new=False, app_id=None, title=None, python=None, conda_mode=False, force_generate=False, log_callback=None)

A function to deploy a Python Dash app module to Connect. Depending on the files involved and network latency, this may take a bit of time.

:param connect_server: the Connect server information. :param directory: the app directory to deploy. :param extra_files: any extra files that should be included in the deploy. :param excludes: a sequence of glob patterns that will exclude matched files. :param entry_point: the module/executable object for the WSGi framework. :param new: a flag to force this as a new deploy. :param app_id: the ID of an existing application to deploy new files for. :param title: an optional title for the deploy. If this is not provided, ne will be generated. :param python: the optional name of a Python executable. :param conda_mode: use conda to build an environment.yml instead of conda, when conda is not supported on RStudio Connect (version<=1.8.0). :param force_generate: force generating "requirements.txt" or "environment.yml", even if it already exists. :param log_callback: the callback to use to write the log to. If this is None (the default) the lines from the deployment log will be returned as a sequence. If a log callback is provided, then None will be returned for the log lines part of the return tuple. :return: the ultimate URL where the deployed app may be accessed and the sequence of log lines. The log lines value will be None if a log callback was provided.

function

rsconnect.actions.deploy_streamlit_app(connect_server, directory, extra_files, excludes, entry_point, new=False, app_id=None, title=None, python=None, conda_mode=False, force_generate=False, log_callback=None)

A function to deploy a Python Streamlit app module to Connect. Depending on the files involved and network latency, this may take a bit of time.

:param connect_server: the Connect server information. :param directory: the app directory to deploy. :param extra_files: any extra files that should be included in the deploy. :param excludes: a sequence of glob patterns that will exclude matched files. :param entry_point: the module/executable object for the WSGi framework. :param new: a flag to force this as a new deploy. :param app_id: the ID of an existing application to deploy new files for. :param title: an optional title for the deploy. If this is not provided, ne will be generated. :param python: the optional name of a Python executable. :param conda_mode: use conda to build an environment.yml instead of conda, when conda is not supported on RStudio Connect (version<=1.8.0). :param force_generate: force generating "requirements.txt" or "environment.yml", even if it already exists. :param log_callback: the callback to use to write the log to. If this is None (the default) the lines from the deployment log will be returned as a sequence. If a log callback is provided, then None will be returned for the log lines part of the return tuple. :return: the ultimate URL where the deployed app may be accessed and the sequence of log lines. The log lines value will be None if a log callback was provided.

function

rsconnect.actions.deploy_bokeh_app(connect_server, directory, extra_files, excludes, entry_point, new=False, app_id=None, title=None, python=None, conda_mode=False, force_generate=False, log_callback=None)

A function to deploy a Python Bokeh app module to Connect. Depending on the files involved and network latency, this may take a bit of time.

:param connect_server: the Connect server information. :param directory: the app directory to deploy. :param extra_files: any extra files that should be included in the deploy. :param excludes: a sequence of glob patterns that will exclude matched files. :param entry_point: the module/executable object for the WSGi framework. :param new: a flag to force this as a new deploy. :param app_id: the ID of an existing application to deploy new files for. :param title: an optional title for the deploy. If this is not provided, ne will be generated. :param python: the optional name of a Python executable. :param conda_mode: use conda to build an environment.yml instead of conda, when conda is not supported on RStudio Connect (version<=1.8.0). :param force_generate: force generating "requirements.txt" or "environment.yml", even if it already exists. :param log_callback: the callback to use to write the log to. If this is None (the default) the lines from the deployment log will be returned as a sequence. If a log callback is provided, then None will be returned for the log lines part of the return tuple. :return: the ultimate URL where the deployed app may be accessed and the sequence of log lines. The log lines value will be None if a log callback was provided.

function

rsconnect.actions.deploy_by_manifest(connect_server, manifest_file_name, new=False, app_id=None, title=None, log_callback=None)

A function to deploy a Jupyter notebook to Connect. Depending on the files involved and network latency, this may take a bit of time.

:param connect_server: the Connect server information. :param manifest_file_name: the manifest file to deploy. :param new: a flag to force this as a new deploy. :param app_id: the ID of an existing application to deploy new files for. :param title: an optional title for the deploy. If this is not provided, ne will be generated. :param log_callback: the callback to use to write the log to. If this is None (the default) the lines from the deployment log will be returned as a sequence. If a log callback is provided, then None will be returned for the log lines part of the return tuple. :return: the ultimate URL where the deployed app may be accessed and the sequence of log lines. The log lines value will be None if a log callback was provided.

function

rsconnect.actions.gather_basic_deployment_info_for_notebook(connect_server, app_store, file_name, new, app_id, title, static)

Helps to gather the necessary info for performing a deployment.

:param connect_server: the Connect server information. :param app_store: the store for the specified file :param file_name: the primary file being deployed. :param new: a flag noting whether we should force a new deployment. :param app_id: the ID of the app to redeploy. :param title: an optional title. If this isn't specified, a default title will be generated. :param static: a flag to note whether a static document should be deployed. :return: the app ID, name, title information and mode for the deployment.

function

rsconnect.actions.gather_basic_deployment_info_from_manifest(connect_server, app_store, file_name, new, app_id, title)

Helps to gather the necessary info for performing a deployment.

:param connect_server: the Connect server information. :param app_store: the store for the specified file :param file_name: the manifest file being deployed. :param new: a flag noting whether we should force a new deployment. :param app_id: the ID of the app to redeploy. :param title: an optional title. If this isn't specified, a default title will be generated. :return: the app ID, name, title information, mode, and package manager for the deployment.

function

rsconnect.actions.get_python_env_info(file_name, python, conda_mode=False, force_generate=False)

Gathers the python and environment information relating to the specified file with an eye to deploy it.

:param file_name: the primary file being deployed. :param python: the optional name of a Python executable. :param conda_mode: inspect the environment assuming Conda :param force_generate: force generating "requirements.txt" or "environment.yml", even if it already exists. :return: information about the version of Python in use plus some environmental stuff.

function

rsconnect.actions.create_notebook_deployment_bundle(file_name, extra_files, app_mode, python, environment, extra_files_need_validating=True, hide_all_input=None, hide_tagged_input=None)

Create an in-memory bundle, ready to deploy.

:param file_name: the Jupyter notebook being deployed. :param extra_files: a sequence of any extra files to include in the bundle. :param app_mode: the mode of the app being deployed. :param python: information about the version of Python being used. :param environment: environmental information. :param extra_files_need_validating: a flag indicating whether the list of extra :param hide_all_input: if True, will hide all input cells when rendering output :param hide_tagged_input: If True, will hide input code cells with the 'hide_input' tag when rendering output files should be validated or not. Part of validating includes qualifying each with the parent directory of the notebook file. If you provide False here, make sure the names are properly qualified first. :return: the bundle.

function

rsconnect.actions.create_api_deployment_bundle(directory, extra_files, excludes, entry_point, app_mode, environment, extra_files_need_validating=True)

Create an in-memory bundle, ready to deploy.

:param directory: the directory that contains the code being deployed. :param extra_files: a sequence of any extra files to include in the bundle. :param excludes: a sequence of glob patterns that will exclude matched files. :param entry_point: the module/executable object for the WSGi framework. :param app_mode: the mode of the app being deployed. :param environment: environmental information. :param extra_files_need_validating: a flag indicating whether the list of extra files should be validated or not. Part of validating includes qualifying each with the specified directory. If you provide False here, make sure the names are properly qualified first. :return: the bundle.

function

rsconnect.actions.deploy_bundle(connect_server, app_id, name, title, title_is_default, bundle)

Deploys the specified bundle.

:param connect_server: the Connect server information. :param app_id: the ID of the app to deploy, if this is a redeploy. :param name: the name for the deploy. :param title: the title for the deploy. :param title_is_default: a flag noting whether the title carries a defaulted value. :param bundle: the bundle to deploy. :return: application information about the deploy. This includes the ID of the task that may be queried for deployment progress.

function

rsconnect.actions.spool_deployment_log(connect_server, app, log_callback)

Helper for spooling the deployment log for an app.

:param connect_server: the Connect server information. :param app: the app that was returned by the deploy_bundle function. :param log_callback: the callback to use to write the log to. If this is None (the default) the lines from the deployment log will be returned as a sequence. If a log callback is provided, then None will be returned for the log lines part of the return tuple. :return: the ultimate URL where the deployed app may be accessed and the sequence of log lines. The log lines value will be None if a log callback was provided.

function

rsconnect.actions.create_notebook_manifest_and_environment_file(entry_point_file, environment, app_mode=None, extra_files=None, force=True, hide_all_input=False, hide_tagged_input=False)

Creates and writes a manifest.json file for the given notebook entry point file. If the related environment file (requirements.txt, environment.yml, etc.) doesn't exist (or force is set to True), the environment file will also be written.

:param entry_point_file: the entry point file (Jupyter notebook, etc.) to build the manifest for. :param environment: the Python environment to start with. This should be what's returned by the inspect_environment() function. :param app_mode: the application mode to assume. If this is None, the extension portion of the entry point file name will be used to derive one. :param extra_files: any extra files that should be included in the manifest. :param force: if True, forces the environment file to be written. even if it already exists. :param hide_all_input: if True, will hide all input cells when rendering output :param hide_tagged_input: If True, will hide input code cells with the 'hide_input' tag when rendering output :return:

function

rsconnect.actions.write_notebook_manifest_json(entry_point_file, environment, app_mode, extra_files, hide_all_input, hide_tagged_input)

Creates and writes a manifest.json file for the given entry point file. If the application mode is not provided, an attempt will be made to resolve one based on the extension portion of the entry point file.

:param entry_point_file: the entry point file (Jupyter notebook, etc.) to build the manifest for. :param environment: the Python environment to start with. This should be what's returned by the inspect_environment() function. :param app_mode: the application mode to assume. If this is None, the extension portion of the entry point file name will be used to derive one. :param extra_files: any extra files that should be included in the manifest. :param hide_all_input: if True, will hide all input cells when rendering output :param hide_tagged_input: If True, will hide input code cells with the 'hide_input' tag when rendering output :return: whether or not the environment file (requirements.txt, environment.yml, etc.) that goes along with the manifest exists.

function

rsconnect.actions.create_api_manifest_and_environment_file(directory, entry_point, environment, app_mode=Python API, extra_files=None, excludes=None, force=True)

Creates and writes a manifest.json file for the given Python API entry point. If the related environment file (requirements.txt, environment.yml, etc.) doesn't exist (or force is set to True), the environment file will also be written.

:param directory: the root directory of the Python API. :param entry_point: the module/executable object for the WSGi framework. :param environment: the Python environment to start with. This should be what's returned by the inspect_environment() function. :param app_mode: the application mode to assume. :param extra_files: any extra files that should be included in the manifest. :param excludes: a sequence of glob patterns that will exclude matched files. :param force: if True, forces the environment file to be written. even if it already exists. :return:

function

rsconnect.actions.write_api_manifest_json(directory, entry_point, environment, app_mode=Python API, extra_files=None, excludes=None)

Creates and writes a manifest.json file for the given entry point file. If the application mode is not provided, an attempt will be made to resolve one based on the extension portion of the entry point file.

:param directory: the root directory of the Python API. :param entry_point: the module/executable object for the WSGi framework. :param environment: the Python environment to start with. This should be what's returned by the inspect_environment() function. :param app_mode: the application mode to assume. :param extra_files: any extra files that should be included in the manifest. :param excludes: a sequence of glob patterns that will exclude matched files. :return: whether or not the environment file (requirements.txt, environment.yml, etc.) that goes along with the manifest exists.

function

rsconnect.actions.write_environment_file(environment, directory)

Writes the environment file (requirements.txt, environment.yml, etc.) to the specified directory.

:param environment: the Python environment to start with. This should be what's returned by the inspect_environment() function. :param directory: the directory where the file should be written.

function

rsconnect.actions.describe_manifest(file_name)

Determine the entry point and/or primary file from the given manifest file. If no entry point is recorded in the manifest, then None will be returned for that. The same is true for the primary document. None will be returned for both if the file doesn't exist or doesn't look like a manifest file.

:param file_name: the name of the manifest file to read. :return: the entry point and primary document from the manifest.