How to Export Slide Decks as Editable PPTX Files Using notebooklm-py
Use the CLI command notebooklm download slide-deck --format pptx or call client.artifacts.download_slide_deck(output_format="pptx") in Python to download fully editable PowerPoint files generated by NotebookLM.
The notebooklm-py library provides a programmatic interface for Google’s NotebookLM, enabling you to export AI-generated slide decks as standard PPTX files. Whether you prefer command-line automation or Python scripting, the tool handles authentication, artifact resolution, and binary streaming to deliver editable presentations compatible with Microsoft PowerPoint, Google Slides, and LibreOffice Impress.
Command Line Interface Method
The fastest way to export slide decks is through the notebooklm CLI, which automatically handles session management and file formatting.
Download the Latest Slide Deck
notebooklm download slide-deck --format pptx
This command resolves your active notebook, filters for artifacts of type SLIDE_DECK (ArtifactTypeCode.SLIDE_DECK = 8 in src/notebooklm/rpc/types.py), and downloads the most recent completed deck.
Export by Name or ID
To retrieve a specific deck when multiple versions exist:
notebooklm download slide-deck --name "Chapter 3 Overview" --format pptx
You can also target the earliest generated deck or request all decks using the --earliest and --all flags respectively.
Batch Export
Export every slide deck in a notebook to a directory:
mkdir -p slides
notebooklm download slide-deck --all ./slides/ --format pptx
The CLI wrapper in src/notebooklm/cli/download.py (lines 171‑202) automatically appends the .pptx extension and validates that your output path matches the requested format.
Python API Method
For programmatic workflows, use the async download_slide_deck method exposed through the ArtifactsAPI class.
import asyncio
from notebooklm import NotebookLMClient
async def export_pptx(notebook_id: str, output_path: str):
# Initialize client from stored credentials
async with await NotebookLMClient.from_storage() as client:
# Download slide deck as editable PPTX
await client.artifacts.download_slide_deck(
notebook_id=notebook_id,
output_path=output_path,
output_format="pptx", # Required parameter for PowerPoint format
)
print(f"Editable PPTX saved to: {output_path}")
# Execute the export
asyncio.run(export_pptx("nb_12345", "presentation.pptx"))
This approach gives you full control over notebook selection, output paths, and error handling while maintaining the same underlying functionality as the CLI.
Implementation Details
Understanding the internal flow helps debug export issues and customize extraction logic.
Source Code Architecture
The export process traverses three architectural layers:
-
CLI Parsing (
src/notebooklm/cli/download.py): Detects--format pptx, setsfile_extension = ".pptx", and bindsoutput_format="pptx"to the_run_artifact_downloadhelper. -
Core API (
src/notebooklm/_artifacts.py, lines 1215‑1290): Thedownload_slide_deckmethod validates the format parameter, filters the RPC response forSLIDE_DECKtype artifacts (defined as constant8insrc/notebooklm/rpc/types.pyline 103), and extracts the binary URL fromartifact[16][4]metadata. -
Transport Layer (
src/notebooklm/_core.py): Executes the authenticated HTTP request via_download_urlto stream the PPTX bytes to your local filesystem.
Artifact Resolution Flow
When you request a PPTX export, notebooklm-py performs these operations:
- Resolves notebook ID using cached authentication tokens from your session storage.
- Queries raw artifacts via the internal RPC layer (
rpc_callin_core.py) to retrieve all generated content. - Filters by type, keeping only entries matching
ArtifactTypeCode.SLIDE_DECK. - Selects target artifact based on your criteria (latest, earliest, by name, or bulk selection).
- Downloads binary data from the URL embedded in the artifact metadata and writes it with the correct MIME type for PPTX files.
Summary
- CLI exports use
notebooklm download slide-deck --format pptxwith optional--name,--earliest, or--allselectors. - Python exports call
await client.artifacts.download_slide_deck(output_format="pptx")within an async context manager. - Core implementation resides in
src/notebooklm/_artifacts.py(lines 1215‑1290), filtering forSLIDE_DECKtype8and extracting download URLs from metadata field[16][4]. - Output files are standard Office Open XML (PPTX) format, editable in any compatible presentation software.
Frequently Asked Questions
Can I export slide decks to formats other than PPTX?
The download_slide_deck method accepts different output_format values depending on the artifact's available export options. While PPTX is the primary editable format, you should check the artifact metadata for additional format strings. The CLI defaults to PPTX when --format is omitted for slide decks, but explicitly specifying --format pptx ensures you receive the editable presentation file rather than a static PDF.
Does exporting PPTX files require authentication?
Yes, both CLI and API methods require valid NotebookLM session tokens. The CLI automatically reads cached credentials from local storage using NotebookLMClient.from_storage(), while programmatic usage requires either pre-authenticated client instances or manual token passing. Without valid tokens, the RPC layer cannot resolve notebook IDs or retrieve artifact metadata.
Can I download older versions of slide decks?
Absolutely. By default, notebooklm-py downloads the most recently generated slide deck. To access earlier versions, use the --earliest flag in the CLI to retrieve the first generated deck, or use --name with a specific deck title. The Python API similarly accepts parameters to target specific artifacts rather than defaulting to the latest.
Are the exported PPTX files compatible with Google Slides?
Yes. The files are standard Office Open XML (.pptx) binaries that follow Microsoft’s ISO/IEC 29500 specification. You can upload them directly to Google Drive and open them in Google Slides for collaborative editing, or open them in LibreOffice Impress, Keynote (with import), or any modern presentation software that supports the PPTX standard.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →