### Setup for Contributor (Frozen Sync, Playwright, Pre-commit) Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Contributor setup involves syncing dependencies with frozen versions, installing Playwright, and setting up pre-commit hooks. ```bash uv sync --frozen --extra browser --extra dev --extra markdown && uv run playwright install chromium && uv run pre-commit install ``` -------------------------------- ### Install notebooklm-py with Browser Support Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Install the package with browser dependencies for initial setup on a workstation. This is a prerequisite for generating the authentication file. ```bash pip install "notebooklm-py[browser]" playwright install chromium notebooklm login # writes ~/.notebooklm/profiles/default/storage_state.json ``` -------------------------------- ### NotebookLM Quick Start Example Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/python-api.md Demonstrates the basic usage of the NotebookLMClient for common tasks like listing notebooks, creating new ones, adding sources, asking questions, and generating audio artifacts. Requires an active asyncio event loop. ```python import asyncio from notebooklm import NotebookLMClient async def main(): # Create client from saved authentication async with NotebookLMClient.from_storage() as client: # List notebooks notebooks = await client.notebooks.list() print(f"Found {len(notebooks)} notebooks") # Create a new notebook nb = await client.notebooks.create("My Research") print(f"Created: {nb.id}") # Add sources await client.sources.add_url(nb.id, "https://example.com/article") # Ask a question result = await client.chat.ask(nb.id, "Summarize the main points") print(result.answer) # Generate a podcast status = await client.artifacts.generate_audio(nb.id) await client.artifacts.wait_for_completion(nb.id, status.task_id) output_path = await client.artifacts.download_audio(nb.id, "podcast.mp3") print(f"Audio saved to: {output_path}") asyncio.run(main()) ``` -------------------------------- ### Canonical Contributor Install and Setup Source: https://github.com/teng-lin/notebooklm-py/blob/main/CLAUDE.md Installs dependencies using uv, activates the virtual environment, and installs Playwright browsers. Run this command for a standard contributor setup. ```bash uv sync --frozen --extra browser --extra dev --extra markdown source .venv/bin/activate uv run playwright install chromium ``` -------------------------------- ### Get Source Guide Parameters Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/rpc-reference.md Illustrates the quadruple-nested parameter structure required for the GET_SOURCE_GUIDE RPC. ```python # Quadruple-nested source ID! params = [[[[source_id]]]] ``` -------------------------------- ### Copy Environment Example Source: https://github.com/teng-lin/notebooklm-py/blob/main/deploy/README.md Copies the example environment file to a new file for configuration. ```bash cp deploy/.env.example deploy/.env ``` -------------------------------- ### Install NotebookLM Skill via CLI Source: https://github.com/teng-lin/notebooklm-py/blob/main/README.md Use this command to install the skill into local directories. It installs to `~/.claude/skills/notebooklm` and `~/.agents/skills/notebooklm`. ```bash notebooklm skill install ``` -------------------------------- ### Install Pre-commit Hooks Source: https://github.com/teng-lin/notebooklm-py/blob/main/CONTRIBUTING.md Installs the pre-commit framework and its associated hooks. This should be run once after the canonical installation. ```bash pre-commit install ``` -------------------------------- ### Contributor Installation and Development Commands Source: https://github.com/teng-lin/notebooklm-py/blob/main/AGENTS.md Installs dependencies, sets up the virtual environment, installs browser binaries for Playwright, and runs linters, formatters, type checkers, and pre-commit hooks. ```bash uv sync --frozen --extra browser --extra dev --extra markdown source .venv/bin/activate uv run playwright install chromium uv run pytest uv run pytest -n auto --dist=worksteal # optional faster local run uv run ruff check . uv run ruff format . uv run mypy src/notebooklm uv run pre-commit run --all-files ``` -------------------------------- ### Set Up Development Environment Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/releasing.md Installs project dependencies using uv, including extras for browser, development, and markdown. Playwright browsers are also installed. ```bash # Canonical contributor install; add --extra mcp/--extra server when # validating those adapters locally. `[all]` also includes mcp+server # and deliberately excludes cookies (Python 3.13+ rookiepy issue). uv sync --frozen --extra browser --extra dev --extra markdown uv run playwright install chromium ``` -------------------------------- ### Contributor Verification Commands Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Verify the installation and setup by checking the version, running the test suite with coverage, and executing all pre-commit hooks. ```bash notebooklm --version uv run pytest --cov=src/notebooklm --cov-report=term-missing --cov-fail-under=90 uv run pre-commit run --all-files ``` -------------------------------- ### Install uv with winget Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Install the `uv` package manager using winget on Windows. This is recommended for contributors. ```bash winget install astral-sh.uv ``` -------------------------------- ### ID-Aware Tab Completion Examples Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/cli-reference.md Demonstrates how to use tab completion for notebook IDs, sources, and artifacts once the completion script is installed. These commands leverage the active profile's live IDs. ```bash notebooklm ask -n # lists notebook IDs (filtered by what you've typed) ``` ```bash notebooklm ask -s # lists sources in the active notebook ``` ```bash notebooklm download audio -a # lists artifacts in the active notebook ``` -------------------------------- ### Install notebooklm-py with Cookie Support Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/python-api.md Install the library with the necessary extras for cookie-based authentication. ```bash pip install "notebooklm-py[cookies]" ``` -------------------------------- ### Add and Manage Sources Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/python-api.md Demonstrates adding various types of sources (URLs, text, files) to a notebook, including options for custom titles and parallel uploads. It also shows how to wait for processing, list existing sources, and perform operations like renaming, refreshing, checking freshness, retrieving full text content, and getting AI-generated guides. ```python from pathlib import Path # Add various source types await client.sources.add_url(nb_id, "https://example.com/article") await client.sources.add_url(nb_id, "https://youtube.com/watch?v=...") # YouTube URLs autodetected await client.sources.add_text(nb_id, "My Notes", "Content here...") await client.sources.add_file(nb_id, Path("./document.pdf")) # Upload a file with a custom display title (rename happens after upload via # UPDATE_SOURCE — a brief registration wait runs even when wait=False so the # rename can land). The mime_type kwarg is optional: omit it to infer the # content-type from the filename extension, or pass it to override inference. await client.sources.add_file(nb_id, Path("./document.pdf"), title="Q4 Strategy Memo") # Wait for several uploads to finish processing in parallel ids = [ (await client.sources.add_url(nb_id, "https://example.com/a")).id, (await client.sources.add_url(nb_id, "https://example.com/b")).id, ] ready = await client.sources.wait_for_sources(nb_id, ids, timeout=180) # Narrow wait: only block until the source is visible server-side (not fully # processed). Use this before follow-up RPCs like UPDATE_SOURCE. registered = await client.sources.wait_until_registered(nb_id, ids[0]) # List and manage sources = await client.sources.list(nb_id) for src in sources: print(f"{src.id}: {src.title} ({src.kind})") await client.sources.rename(nb_id, src.id, "Better Title") await client.sources.refresh(nb_id, src.id) # Re-fetch URL content # Check if a source needs refreshing (content changed) is_fresh = await client.sources.check_freshness(nb_id, src.id) if not is_fresh: await client.sources.refresh(nb_id, src.id) # Get full indexed content (what NotebookLM uses for answers) fulltext = await client.sources.get_fulltext(nb_id, src.id) print(f"Content ({fulltext.char_count} chars): {fulltext.content[:500]}...") # Get AI-generated summary and keywords (returns a typed SourceGuide) guide = await client.sources.get_guide(nb_id, src.id) print(f"Summary: {guide.summary}") print(f"Keywords: {guide.keywords}") # SourceGuide is a typed value; prefer attribute access. ``` -------------------------------- ### Install uv / uvx Source: https://github.com/teng-lin/notebooklm-py/blob/main/desktop-extension/README.md Install the uv package manager and its shell command `uvx` using the official installation script for macOS/Linux or PowerShell for Windows. These tools are used by the launcher to resolve and run the server from PyPI. ```bash # macOS / Linux curl -LsSf https://astral.sh/uv/install.sh | sh ``` ```powershell # Windows (PowerShell) powershell -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Example Cassette Usage in Python Source: https://github.com/teng-lin/notebooklm-py/blob/main/tests/cassettes/README.md Demonstrates how to use the `use_cassette` decorator with an example cassette located in the 'examples/' subdirectory. ```python @notebooklm_vcr.use_cassette("examples/example_scrubbed_cookies.yaml") ``` -------------------------------- ### Install Playwright from Git Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/troubleshooting.md If you need a non-editable install from Git, use this command instead of the local checkout installation step. ```bash pip install "git+https://github.com//notebooklm-py@" ``` -------------------------------- ### Install NotebookLM Python Server Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Install the NotebookLM Python package with the server extra, which includes FastAPI, Uvicorn, and python-multipart. Alternatively, use pipx for global installation. ```bash uv tool install "notebooklm-py[server]" # fastapi + uvicorn + python-multipart # OR, with pipx: pipx install "notebooklm-py[server]" (or plain pip inside a venv) ``` -------------------------------- ### Install NotebookLM MCP Server Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/mcp-guide.md Install the NotebookLM Python package with the MCP extra, which includes the necessary server dependencies. Alternatively, use `uvx` to run the server directly from PyPI without a local installation. ```bash pip install "notebooklm-py[mcp]" # or run with no install, straight from PyPI: uvx --from "notebooklm-py[mcp]" notebooklm-mcp --help ``` -------------------------------- ### Install NotebookLM Skill via npx Source: https://github.com/teng-lin/notebooklm-py/blob/main/README.md Install the skill using npx to fetch the canonical SKILL.md directly from GitHub. This method is useful for leveraging the open skills ecosystem. ```bash npx skills add teng-lin/notebooklm-py ``` -------------------------------- ### Install MCP Extension for Other Clients Source: https://github.com/teng-lin/notebooklm-py/blob/main/desktop-extension/README.md Install the NotebookLM MCP extension for clients that use JSON configuration instead of `.mcpb` files. Use the `notebooklm mcp install` command followed by the client name. ```bash notebooklm mcp install claude-code # or: cursor / windsurf / claude-desktop ``` -------------------------------- ### Start NotebookLM server with a specific profile Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/mcp-guide.md Start the NotebookLM server process bound to a specific profile. This is useful for managing multiple accounts. ```bash notebooklm --profile server ``` -------------------------------- ### Install uv (Windows) Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/mcp-guide.md Install the 'uv' package manager using a PowerShell command. This is necessary if 'uv' or 'uvx' commands are not found. ```powershell powershell -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Install MCP client configuration Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/mcp-guide.md Install the MCP configuration for a specific client. This ensures the client can discover and use the available tools. ```bash notebooklm mcp install ``` -------------------------------- ### Verify notebooklm CLI installation Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Check the installed version of the notebooklm CLI, initiate the login process which opens Chromium for Google sign-in, and confirm the authentication roundtrip. ```bash notebooklm --version notebooklm login # opens Chromium for Google sign-in notebooklm auth check --test # confirms auth roundtrip, with explicit success message ``` -------------------------------- ### First End-to-End Run Example Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Execute a sequence of commands to create a notebook, add a source, and ask a question. This demonstrates a typical user workflow. ```bash notebooklm create "My First Notebook" notebooklm source add 'https://en.wikipedia.org/wiki/Python_(programming_language)' notebooklm ask "Summarize the sources in three sentences" ``` -------------------------------- ### NotebookLMClient Quick Start Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/python-api.md Demonstrates the basic usage of the NotebookLMClient, including creating a client, listing notebooks, creating a new notebook, adding sources, asking questions, and generating audio artifacts. ```APIDOC ## NotebookLMClient Quick Start ### Description This example shows how to use the `NotebookLMClient` to interact with the NotebookLM service. It covers common operations such as managing notebooks, adding data sources, querying the model, and generating audio. ### Method Asynchronous Python functions ### Endpoint N/A (Python SDK) ### Parameters N/A (Python SDK) ### Request Example ```python import asyncio from notebooklm import NotebookLMClient async def main(): # Create client from saved authentication async with NotebookLMClient.from_storage() as client: # List notebooks notebooks = await client.notebooks.list() print(f"Found {len(notebooks)} notebooks") # Create a new notebook nb = await client.notebooks.create("My Research") print(f"Created: {nb.id}") # Add sources await client.sources.add_url(nb.id, "https://example.com/article") # Ask a question result = await client.chat.ask(nb.id, "Summarize the main points") print(result.answer) # Generate a podcast status = await client.artifacts.generate_audio(nb.id) await client.artifacts.wait_for_completion(nb.id, status.task_id) output_path = await client.artifacts.download_audio(nb.id, "podcast.mp3") print(f"Audio saved to: {output_path}") asyncio.run(main()) ``` ### Response N/A (Python SDK - output is printed to console) ``` -------------------------------- ### Run MCP Server Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Starts the Model Context Protocol (MCP) server. This can be run directly as a console script if installed, or executed from PyPI without installation using `uvx`. ```bash notebooklm-mcp ``` ```bash uvx --from "notebooklm-py[mcp]" notebooklm-mcp ``` -------------------------------- ### Prepare deployment environment variables Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/mcp-guide.md Copy the example environment file and edit it according to the provided steps. This file contains settings for the deployment, including profile directory and authentication details. ```bash # 2. secrets: cp deploy/.env.example deploy/.env # edit per the steps below # NOTEBOOKLM_PROFILE_DIR defaults to ~/.notebooklm/profiles/default (override for a throwaway profile) ``` -------------------------------- ### Retrieve Source Information Source: https://github.com/teng-lin/notebooklm-py/blob/main/SKILL.md Get the full text content or a guide for a specific source using its ID. ```bash notebooklm source fulltext ``` ```bash notebooklm source guide ``` -------------------------------- ### Create Notebook and Add Sources with CLI Source: https://github.com/teng-lin/notebooklm-py/blob/main/README.md Create a new notebook and add sources from URLs or local files. Use the `use` command to select a notebook by its ID before adding sources. ```bash # 2. Create a notebook and add sources notebooklm create "My Research" notebooklm use notebooklm source add "https://en.wikipedia.org/wiki/Artificial_intelligence" notebooklm source add "./paper.pdf" ``` -------------------------------- ### Fallback Contributor Install with Pip Source: https://github.com/teng-lin/notebooklm-py/blob/main/CONTRIBUTING.md Installs project dependencies using pip when uv is not available. This method may resolve newer dependency versions than CI and requires manual setup of the virtual environment and Playwright. ```bash python -m venv .venv && source .venv/bin/activate pip install -e ".[all]" # [all] = browser + dev + markdown + mcp + server (no cookies; see installation.md) playwright install chromium pre-commit install ``` -------------------------------- ### Setup Generation Notebook Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/development.md Run this script once per Google account to set up a dedicated notebook for cassette recording. It creates or reuses a notebook and prints its UUID for environment configuration. ```bash uv run python tests/scripts/setup-generation-notebook.py ``` -------------------------------- ### Get Notes and Mind Maps Parameters Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/rpc-reference.md Parameters for the GET_NOTES_AND_MIND_MAPS RPC call. The second set of parameters shows an example of a refresh call. ```python params = [notebook_id] # Live web UI/CDP capture on 2026-06-15: params = [ notebook_id, None, None, # Refresh calls may send a timestamp here, e.g. [seconds, nanos] [2, None, None, [1, None, None, None, None, None, None, None, None, None, [1]]], ] ``` -------------------------------- ### Install notebooklm-py and Bootstrap Master Token Source: https://github.com/teng-lin/notebooklm-py/blob/main/deploy/README.md Install the necessary Python package and log in to bootstrap the master token. Ensure you use a dedicated or throwaway Google account for security. ```bash pip install "notebooklm-py[browser,headless]" notebooklm login --master-token --account you@example.com ``` -------------------------------- ### Python API for Notebook Sharing Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/rpc-reference.md Provides examples of how to use the client.sharing module for common notebook sharing operations. This includes getting sharing status, setting public access, adjusting the view level, and managing user permissions. ```python # Use client.sharing for all sharing operations status = await client.sharing.get_status(notebook_id) await client.sharing.set_public(notebook_id, True) await client.sharing.set_view_level(notebook_id, ShareViewLevel.CHAT_ONLY) await client.sharing.add_user(notebook_id, "user@example.com", SharePermission.VIEWER) ``` -------------------------------- ### Create Notebook Source: https://github.com/teng-lin/notebooklm-py/blob/main/SKILL.md Initiates a new notebook with a specified topic. If authentication fails, check your login status. ```bash notebooklm create "Research: [topic]" ``` -------------------------------- ### Start and Manage Research Tasks with ResearchAPI Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/python-api.md Initiate a research task, capture its ID, and wait for completion. Always pass the task_id to poll() for unambiguous targeting, especially when multiple concurrent tasks are running. This example shows how to import up to 5 sources from a completed research task. ```python # Start research and capture the task_id discriminator (typed ResearchStart) result = await client.research.start(nb_id, "AI safety regulations") task_id = result.task_id # If you launch multiple concurrent research tasks on the same notebook # (web vs drive, fast vs deep), always pass the task_id to poll() so the # poll resolves to the intended task. Without it, poll() returns the # "latest task" and emits an ambiguity warning when multiple are in flight. # Wait until complete (always pass task_id for unambiguous targeting) status = await client.research.wait_for_completion( nb_id, task_id=task_id, timeout=1800, initial_interval=5, ) # `status` is a typed ResearchTask; `.sources` are ResearchSource objects, # which import_sources accepts directly. imported = await client.research.import_sources(nb_id, task_id, list(status.sources)[:5]) print(f"Imported {len(imported)} sources") ``` -------------------------------- ### Contributor Installation with uv sync --frozen Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md This command sequence clones the repository, synchronizes dependencies using a lockfile for consistency, activates the virtual environment, installs browser dependencies, and sets up pre-commit hooks. It's recommended for contributors to ensure reproducible builds. ```bash git clone https://github.com/teng-lin/notebooklm-py.git cd notebooklm-py uv sync --frozen --extra browser --extra dev --extra markdown source .venv/bin/activate uv run playwright install chromium pre-commit install ``` -------------------------------- ### List, Create, and Rename Notebooks Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/python-api.md Demonstrates basic notebook management operations: listing all notebooks, creating a new notebook with a title, and renaming an existing notebook. Ensure the client is initialized before use. ```python # List all notebooks notebooks = await client.notebooks.list() for nb in notebooks: print(f"{nb.id}: {nb.title} ({nb.sources_count} sources)") ``` ```python # Create and rename nb = await client.notebooks.create("Draft") nb = await client.notebooks.rename(nb.id, "Final Version") ``` -------------------------------- ### Install Playwright Chromium Dependencies Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Installs system libraries required by Playwright for Chromium on Debian/Ubuntu systems. This command should be run after `playwright install chromium`. ```bash playwright install-deps chromium ``` -------------------------------- ### Verify Example Script Syntax Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/releasing.md Compiles example Python scripts to check for syntax errors. This command ensures all scripts in the examples directory are valid. ```bash uv run python -m py_compile examples/*.py ``` -------------------------------- ### YouTube Video to Quick Summary Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/cli-reference.md Create a notebook, add a YouTube video as a source, and generate a summary or notes. You can also ask specific questions about the video content and generate a briefing document. ```bash # 1. Create notebook and add video notebooklm create "Video Notes" notebooklm use notebooklm source add "https://www.youtube.com/watch?v=VIDEO_ID" # 2. Get summary notebooklm summary # 3. Ask questions notebooklm ask "What are the main points?" notebooklm ask "Create bullet point notes" # 4. Generate a quick briefing doc notebooklm generate report --format briefing-doc --wait ``` -------------------------------- ### Install Skill Command Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/cli-reference.md Installs or updates agent skills. Defaults to user scope and all targets. Project-scope installs support `--dry-run`, `--no-clobber`, and `--force`. ```bash skill install --target all ``` -------------------------------- ### Install notebooklm-py with extras for Power User (Specific Python) Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md For power users, install with specific extras like 'browser', 'cookies', and 'markdown'. Use `--python 3.12` to ensure uv provisions a matching interpreter if your default is newer. ```bash uv tool install --python 3.12 "notebooklm-py[browser,cookies,markdown]" ``` -------------------------------- ### Install notebooklm-py with browser extra for AI Agent Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Use this command for AI Agent persona. If you encounter an 'externally-managed-environment' error, fall back to `uv tool install` or `pipx install`. ```bash pip install "notebooklm-py[browser]" ``` -------------------------------- ### Install Dependencies Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/development.md Installs project dependencies using uv, including extras for browser testing, development, and markdown processing. Also installs Playwright's Chromium browser and pre-commit hooks. ```bash uv sync --frozen --extra browser --extra dev --extra markdown uv run playwright install chromium uv run pre-commit install ``` -------------------------------- ### Verify Package Installation Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md Check if the notebooklm package is installed correctly. This is a fundamental check. ```bash notebooklm --version ``` -------------------------------- ### NotebookLMClient Initialization from Storage Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/python-api.md Provides a class method to initialize the NotebookLMClient from storage, returning an async-context-manager wrapper. Use this method within an `async with` statement for proper resource management. Deprecated for direct awaiting. ```python @classmethod def from_storage( cls, path: str | None = None, timeout: float = 30.0, profile: str | None = None, keepalive: float | None = None, keepalive_min_interval: float = 60.0, rate_limit_max_retries: int = 3, server_error_max_retries: int = 3, limits: ConnectionLimits | None = None, max_concurrent_uploads: int | None = DEFAULT_MAX_CONCURRENT_UPLOADS, # 4 max_concurrent_rpcs: int | None = DEFAULT_MAX_CONCURRENT_RPCS, # 16 upload_timeout: httpx.Timeout | None = None, on_rpc_event: Callable[[RpcTelemetryEvent], object] | None = None, chat_timeout: float | None = DEFAULT_CHAT_TIMEOUT, # 180 ) -> "_FromStorageContext": # Returns an awaitable async-context-manager wrapper. Use as # `async with NotebookLMClient.from_storage(...) as client: `. # Awaiting it directly (legacy) emits DeprecationWarning; # removed in v1.0. ``` -------------------------------- ### get_guide Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/python-api.md Retrieves AI-generated summary and keywords for a source. ```APIDOC ## get_guide ### Description Get AI-generated `summary` and `keywords` for a source. Access details using attribute access (e.g., `guide.summary`). ### Method `get_guide(notebook_id, source_id)` ### Parameters #### Path Parameters - **notebook_id** (str) - Required - The ID of the notebook. - **source_id** (str) - Required - The ID of the source. ### Returns - **SourceGuide** - An object containing the AI-generated summary and keywords. ``` -------------------------------- ### Generate Study Guide Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/python-api.md Generates a Study Guide report artifact for the specified notebook. ```APIDOC ## generate_study_guide(...) ### Description Generate a Study Guide report. ### Parameters #### Path Parameters - **Parameters** (See below) - Required - Parameters for study guide generation. ### Returns - **GenerationStatus** - The status of the generation process. ``` -------------------------------- ### Feature API Constructor Examples Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/refactor-history.md Illustrates the constructor signatures for various feature APIs, showcasing dependency injection and keyword-only arguments. ```python SourcesAPI(rpc, *, uploader=source_uploader) ``` ```python NotebooksAPI(rpc, *, sources_api=sources) ``` ```python ChatAPI(rpc=rpc, transport=transport, reqid=reqid, loop_guard=lifecycle, notebooks=notebooks) ``` ```python ArtifactsAPI(rpc=rpc, drain=drain, lifecycle=lifecycle, notebooks=notebooks, mind_maps=mind_maps, note_service=note_service) ``` ```python NotesAPI(*, notes=note_service, mind_maps=mind_maps) ``` ```python MindMapsAPI(rpc=rpc, mind_maps=mind_maps, artifacts=artifacts, notebooks=notebooks) ``` ```python LabelsAPI(rpc, list_sources=sources.list) ``` -------------------------------- ### Canonical Contributor Install Source: https://github.com/teng-lin/notebooklm-py/blob/main/CONTRIBUTING.md Installs project dependencies using uv, activates the virtual environment, installs Playwright browsers, and sets up pre-commit hooks. This method respects the uv.lock file for reproducible builds. ```bash uv sync --frozen --extra browser --extra dev --extra markdown source .venv/bin/activate uv run playwright install chromium pre-commit install ``` -------------------------------- ### Add Sources and Ask a Question Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/mcp-guide.md Create a notebook, add sources from URLs and text, wait for processing, and then ask a question. Supports various source types like url, text, file, drive, and youtube. ```python nb = notebook_create(title="Quantum Computing") source_add(notebook="Quantum Computing", source_type="url", url="https://arxiv.org/abs/ப்புகளை") source_add(notebook="Quantum Computing", source_type="text", title="Notes", text="...") source_wait(notebook="Quantum Computing") # block until sources finish processing chat_ask(notebook="Quantum Computing", question="What are the open problems?") ``` -------------------------------- ### Video Overview Custom Style Example Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/rpc-reference.md Illustrates the JSON array structure for a custom video style, omitting default values and appending the custom style prompt. ```json [ source_ids_double, "en", "Focus prompt", None, 2, # VideoFormat.BRIEF None, # VideoStyle.CUSTOM omitted/defaulted "Custom visual style", ] ``` -------------------------------- ### Generate Audio Overview Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/cli-reference.md Generate an audio overview (podcast) for a notebook. This command can be run asynchronously or with a `--wait` flag. Use `--prompt-file` for longer descriptions. ```bash notebooklm generate audio [description] [OPTIONS] ``` ```bash # Basic podcast (starts async, returns immediately) notebooklm generate audio ``` ```bash # Debate format with custom instructions notebooklm generate audio "Compare the two main viewpoints" --format debate ``` ```bash # Generate and wait for completion notebooklm generate audio "Focus on key points" --wait ``` ```bash # Generate using only specific sources notebooklm generate audio -s src_abc -s src_def ``` ```bash # JSON output for scripting/automation notebooklm generate audio --json # Output: {"task_id": "abc123...", "status": "pending"} ``` ```bash # Read long instructions from a file notebooklm generate audio --prompt-file instructions.txt --format debate ``` -------------------------------- ### Connect Client to MCP Server Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/mcp-guide.md Use the `notebooklm mcp install` command to automatically configure a client to connect to the MCP server. This command is idempotent and will not overwrite existing server configurations. Supported clients include Claude Desktop, Claude Code, Cursor, and Windsurf. ```bash notebooklm mcp install claude-desktop # or: claude-code | cursor | windsurf ``` -------------------------------- ### Workaround Playwright Install Failure on Linux Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/troubleshooting.md Use this workaround to install a specific older version of Playwright if the default installation fails on Linux. This involves creating a virtual environment and using pip to override version constraints. ```bash python -m venv .venv source .venv/bin/activate pip install -U pip pip install "playwright==1.57.0" python -m playwright install chromium pip install -e ".[all]" ``` -------------------------------- ### Create and Switch to a Profile Source: https://github.com/teng-lin/notebooklm-py/blob/main/docs/cli-reference.md Creates a new profile named 'work' and then logs into it. This is typically the first step in setting up a new profile. ```bash notebooklm profile create work notebooklm -p work login ```