Draw Matplotlib plots in Google Slides using the API.
This library converts plot elements into native objects in Google Slides (lines, shapes, groups) and inserts them into a presentation. Useful for scalable, editable slide exports.
Install from source:
pip install .Or, in development mode:
pip install -e .To use the Google Slides API, you’ll need to authenticate with your own Google account:
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Enable both the Google Slides API and Google Drive API.
- Go to APIs & Services → Credentials.
- Create an OAuth 2.0 Client ID (type: Desktop App).
- Download the
credentials.jsonfile. - On first run, a browser will open asking for permission. A
token.jsonwill be saved for future sessions.
Tip: Set the GSLIDES_CREDENTIALS and GSLIDES_TOKEN environment variables as paths to your credentials and token. Otherwise, you’ll have to provide the paths in your script.
import mpl2gslidesSee examples in the examples/ directory.
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license.
This means you can use, modify, and share the code for non-commercial purposes only, with attribution.
See LICENSE for full details.