Skip to content
pygwalker
api-reference

PyGWalker API Reference

Use pygwalker.walk(df) for a quick interactive explorer. Use pygwalker.Walker(...) when the same dataset, chart state, and computation mode should be reused across notebooks, Streamlit, webserver, or HTML export.

import pygwalker as pyg
 
walker = pyg.Walker(df, spec_path="./gw_config.json", computation="browser")
walker.show()

Choose an entrypoint

APIBest forNotes
pygwalker.walk(dataset, ...)Quick exploration in notebooks or scriptsUses anywidget in Jupyter by default and a local webserver outside notebooks.
pygwalker.Walker(dataset, ...)Reusing one PyGWalker object across adaptersPut construction options such as spec_path, field_specs, and computation on the Walker.
pygwalker.render(dataset, spec=..., ...)Rendering saved charts without the full explorerUse spec_path for local chart files.
pygwalker.table(dataset, ...)Opening the table/profiling viewAccepts the same dataset and computation options as render.
pygwalker.to_html(dataset_or_walker, ...)Static HTML exportBrowser-only. It rejects computation="kernel" and computation="cloud".
StreamlitRenderer(dataset_or_walker, ...)Streamlit appsCache the renderer with st.cache_resource for long-lived apps.
get_html_on_gradio(dataset, ...)Gradio appsReturn the iframe HTML and mount PYGWALKER_ROUTE.
pygwalker.component(dataset, ...)Programmatic chart buildersChain mark, encode, layout, and export methods.
pygwalker.spec.migrate(spec)Updating saved chart stateAccepts a loaded spec object, JSON string, or local file path.

Supported datasets

Most public APIs accept pandas DataFrame, polars DataFrame, pyarrow Table, database Connector, and connector-style SQL/data-source strings where the adapter supports connectors. pygwalker.walk, notebook anywidget/marimo/webserver adapters, StreamlitRenderer, and to_html can also accept a reusable pygwalker.Walker object.

See Dataset Inputs for details and examples.

Common options

OptionTypeDefaultUse
spec_pathstr or NoneNoneLocal chart-state file to load from and save to. Prefer this over passing a local file path through spec.
specstr""Inline JSON, config ID, or remote spec URL.
computationauto, browser, kernel, cloud, or NoneNoneChoose where PyGWalker runs data queries. Omit it or use "auto" for automatic behavior.
field_specsList[FieldSpec] or NoneNoneOverride inferred field semantic and analytic types.
theme_keyvega, g2, or streamlit"g2"Select the renderer theme family.
appearancemedia, light, or dark"media"media follows the operating system color scheme.
default_tabdata or vis"vis"Choose the initial tab for explorer views.

Computation modes

Use computation, not the legacy computation booleans.

ValueBehaviorTypical use
omitted or "auto"Keep PyGWalker's automatic mode selectionDefault for most users.
"browser"Run data queries in the frontend/browserStatic HTML exports and smaller local data.
"kernel"Run queries through local DuckDB-backed Python computationLarger local datasets in live notebook, Streamlit, Gradio, or webserver sessions.
"cloud"Run queries through Kanaries cloud computationCloud-backed workflows with a Kanaries API key.

kernel_computation, cloud_computation, and use_kernel_calc are legacy compatibility flags. They are deprecated and scheduled for removal in PyGWalker 0.7.0. Do not combine enabled legacy flags with a non-auto computation value; PyGWalker raises ValueError.

See Computation Modes for migration examples.

Reuse a Walker

Create a Walker when multiple adapters should share one configuration.

import pygwalker as pyg
 
walker = pyg.Walker(
    df,
    spec_path="./gw_config.json",
    spec_io_mode="rw",
    computation="kernel",
)
 
walker.show()
renderer = walker.to_streamlit()

When an adapter receives a Walker, construction options must already be on the Walker. For example, pyg.to_html(walker, spec_path="./other.json") is rejected because it would try to rebuild the existing object with conflicting state.

Static HTML limits

Static HTML exports do not have a live Python or cloud backend. Use computation="browser" or omit the computation option when calling pyg.to_html(...), walker.to_html(), or component HTML exports. Use a live adapter such as Notebook APIs, Streamlit, or Gradio for kernel or cloud computation.

Related Guides