← 返回首页
Expose `plotly.io.get_chrome()` by emilykl · Pull Request #5282 · plotly/plotly.py · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Expose plotly.io.get_chrome()#5282

Merged
emilykl merged 3 commits into
mainfrom
5272-add-plotly-io-get-chrome
Jul 16, 2025
Merged

Expose plotly.io.get_chrome()#5282
emilykl merged 3 commits into
mainfrom
5272-add-plotly-io-get-chrome

Conversation

Copy link
Copy Markdown
Contributor

emilykl commented Jul 16, 2025
edited
Loading

Closes #5272

Expose plotly.io.get_chrome() as a function which can be called from within a Python script.

get_chrome() accepts one optional argument, path, which is the location to download Chrome to; if not supplied, the default location defined by choreographer will be used.

This PR also slightly refactors get_chrome() into two functions:

  • get_chrome(), which is intended to be called directly in code, and
  • plotly_get_chrome(), which is a CLI wrapper for get_chrome() and intended to be called via the plotly_get_chrome command from the command line.

On this branch, running the following code should work:

import plotly.io as pio pio.get_chrome()

emilykl requested review from LiamConnors and gvwilson July 16, 2025 19:07
Comment thread plotly/io/_kaleido.py
The path to the directory where Chrome should be installed.
If None, the default download path will be used.
"""
if not kaleido_available() or kaleido_major() < 1:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

why a confirmation? (not arguing, just think it's very unlikely someone would call the function by accident)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Do you mean the one on line 837? I agree it's unlikely to be called by accident, but I mainly put it there so users could confirm that the install path makes sense.

In any case, the confirmation only appears when using the command-line plotly_get_chrome command, not when calling the plotly.io.get_chrome() function within a script.

Hide details View details emilykl merged commit 4cd70ad into main Jul 16, 2025
10 checks passed
emilykl deleted the 5272-add-plotly-io-get-chrome branch November 6, 2025 18:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug Report: plotly.io.install_chrome() documented but doesn't exist

3 participants

Footer

© 2026 GitHub, Inc.