{
 "schema_version": 1,
 "generated": "2026-11-01",
 "id": "kanaries-pygwalker--turn-exploration-into-reproducible-code",
 "repo": "Kanaries/pygwalker",
 "repo_url": "https://github.com/Kanaries/pygwalker",
 "repo_slug": "kanaries-pygwalker",
 "title": "Turn charts you built by hand into reproducible code",
 "page_title": "How to turn charts you built by hand into reproducible code with Pygwalker",
 "summary": "Save chart state with spec_path, then export it with to_code or as PNG and SVG files.",
 "who": "A data scientist who explored visually and now needs the same charts in a report or pipeline.",
 "problem": "Charts made by clicking around are hard to reproduce or put under version control.",
 "outcome": "Saved chart configs plus Python code and image files you can commit and rerun.",
 "steps": [
  "Open the walker with a spec file: `walker = pyg.walk(df, spec_path=\"./chart_meta_0.json\")`",
  "Build your chart in the UI and click the save button",
  "Export the image with `walker.save_chart_to_file(\"Chart 1\", \"chart1.svg\", save_type=\"svg\")` or export_chart_png",
  "Get reproducible Python with `code = walker.to_code(dataset_name=\"df\")`",
  "Migrate older saved specs with pyg.spec.migrate before committing them"
 ],
 "agent_prompt": "With Kanaries/pygwalker, open <dataframe> with a spec_path, and once I have saved <chart name> in the UI, export it to SVG and PNG and generate the reproducible code with to_code. Put the code in <script file>.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Beginner",
 "time": "20 minutes",
 "basis": "readme",
 "caveat": "Chart export works on charts saved from the UI, so save first and then export.",
 "category": "Data and analytics",
 "tags": [
  "Data and analytics"
 ],
 "lang": "python",
 "requirements": [
  "Python with pandas, polars or pyarrow data",
  "Jupyter Notebook, JupyterLab, Colab or Kaggle, or Streamlit for a web app",
  "pip, conda or mamba to install"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/kanaries-pygwalker/turn-exploration-into-reproducible-code/",
 "md": "https://dedupedai.com/use-cases/kanaries-pygwalker/turn-exploration-into-reproducible-code/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/kanaries-pygwalker--turn-exploration-into-reproducible-code.json",
 "api_version": "v1"
}
