Framework for Python

Publishing

publish()

Upload a file or folder to the project's storage bucket.

Usage

publish(
    source: Any,
    dest: str | None = None,
    connection: str | None = None,
    overwrite: bool = True,
    self_contained: bool = True,
    slug: str | bool | None = None,
    include_private: bool = False,
    *,
    to: str | None = None,
    allow_private: bool | None = None,
    title: str | None = None,
    description: str | None = None,
    kind: str | None = None,
    password: str | None = None,
    visibility: str | None = None,
    collection: str | int | None = None,
    share_unlisted: bool = False,
) -> str | list[str]

Arguments

Name Type Default Description
source required Any

A file, a rendered folder, or an object. Accepted objects are pandas and polars DataFrames and Series, numpy arrays with one or two dimensions, pandas Styler tables, scipy.stats test results, statsmodels results, fitted scikit-learn, xgboost, and lightgbm models, matplotlib Figures and Axes, seaborn plots and grids, plotly Figures, and altair charts. On Framework Cloud, tables become typed tables with column summaries (every row is kept), tests and models become structured summaries, and static plots become SVG. Model exports carry coefficients, importance, and fit statistics, never observations, residuals, or serialized models. Buckets receive CSV tables, PNG figures, and HTML model summaries; Styler tables, plotly figures, and altair charts keep their HTML or Vega-Lite form everywhere.

dest str | None None

Where to put it in the bucket. Default: the source's name.

connection str | None None

A storage bucket name. Default: the project's default bucket.

overwrite bool True

Accepted for parity with R; uploads always replace.

self_contained bool True

For Framework Cloud publishing.

slug str | bool | None None

For Framework Cloud publishing.

include_private bool False

Upload files with "private" in their path without asking. Only a person who has reviewed the files should set this.

to str | None None

"cloud" explicitly publishes to Framework Cloud and "bucket" selects storage. "github" publishes to the project's GitHub Pages site: the page is copied to published/<slug>/ at the top of the repository, only that folder is committed, and the commit is pushed. Pages sites are public, even from a private repository. Default: a storage bucket or Framework Cloud.

allow_private bool | None None

Deprecated name for include_private.

title str | None None

Artifact title on Framework Cloud.

description str | None None

Artifact description on Framework Cloud.

kind str | None None

Optional artifact kind override on Framework Cloud.

password str | None None

Password required to view an artifact on Framework Cloud.

visibility str | None None

"public" or "unlisted" on Framework Cloud.

collection str | int | None None

Existing project collection ID or slug; follows the latest artifact version.

share_unlisted bool False

Explicitly allow collection readers to access an unlisted artifact.

Value

The public URL, or a list of URLs for a folder.