Skip to content
Framework

Publishing

flatten_versions()

Keep only an artifact's newest version on Framework Cloud, as version 1.

::

fw.flatten_versions("education-health")
fw.flatten_versions("fig-1", project="study", confirm=True)  # in a script

Usage

flatten_versions(
    artifact: str,
    *,
    project: str | None = None,
    confirm: bool | None = None,
) -> str | None

Arguments

Name Type Default Description
artifact required str

The artifact's slug.

project str | None None

The project's slug, when several of your projects have an artifact with this slug. Not needed with a project token.

confirm bool | None None

True flattens without asking; False cancels. None asks in a console, where the default answer is No.

Value

The artifact's page on Framework Cloud, or None when cancelled.

Details

Older versions and their files are deleted for good, the Trash included. Links and embeds of old versions go to the latest, and collection and report pins move to version 1. The next publish continues after the highest old number. Every kind flattens. An external publication is refused.

A project token (FW_PROJECT_TOKEN, or the project's .env) flattens the project's own artifacts. Otherwise the account token from cloud_login() is used.

Raises

  • FrameworkError: Without a console and without confirm=True.
  • CloudError: No artifact has the slug, several projects do and project is not given, or the server refused.

Search guides and reference for R, Python, Stata, the CLI, and Framework Cloud.