Choreographer
Choreographer is a Python library by Plotly that enables remote control of browsers, primarily for generating static images from browser-based charting tools, but also supports other use cases. It acts as a DevTools Protocol implementation for Chrome-ish browsers, leveraging the user's local Chrome binary. Currently at version 1.2.1, it is actively developed with recent updates in late 2025.
Warnings
- gotcha Choreographer is currently a work in progress and primarily supports Chrome-ish browsers. Support for other browsers is planned but not yet implemented.
- gotcha The library strongly recommends using `async/await` for asynchronous operations. While synchronous functions exist, they are intended as building blocks and might not be as efficient or robust for complex scenarios.
- gotcha Choreographer interacts with the Chrome binary on the user's machine. This means you need a local installation of a compatible browser for the library to function.
Install
-
pip install choreographer
Imports
- Browser
import choreographer as choreo browser = await choreo.Browser()
Quickstart
import asyncio
import choreographer as choreo
async def main():
# Launch a headless browser (default is headless=True)
# To see the browser, use headless=False. Ensure a Chrome-compatible browser is installed.
try:
browser = await choreo.Browser(headless=True)
print(f"Browser launched: {browser.url}")
# Create a new tab
new_tab = await browser.new_tab()
print(f"New tab created: {new_tab.url}")
# Navigate to a URL
await new_tab.navigate("https://www.google.com")
print(f"Navigated to: {await new_tab.get_url()}")
# Wait for a few seconds to observe (optional)
await asyncio.sleep(3)
# Close the tab and then the browser
await new_tab.close()
await browser.close()
print("Browser and tab closed successfully.")
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
asyncio.run(main())