Registry / llm-agents / notebooklm-py

notebooklm-py

JSON →
library0.3.4pypypi✓ verified 84d ago

Unofficial Python library for automating Google NotebookLM. Current version 0.3.4, requires Python >=3.10. Released under MIT license. Active development with frequent releases (multiple per month).

pip install notebooklm-py
INSTALL
IMPORT
SIG · NOTEBOOKLM-PY
N
notebooklm-py
llm-agentspythonv0.3.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NotebookLMClient
from notebooklm import NotebookLMClient
The main client class; instantiate with auth token or interactive login.
SourceType
from notebooklm.models import SourceType
from notebooklm import SourceType
SourceType and ArtifactType are in notebooklm.models, not top-level.
AskResult
from notebooklm.models import AskResult
from notebooklm import AskResult
Model classes live in notebooklm.models.

Initialize client (with auth JSON or interactive login), list notebooks, ask a question.

from notebooklm import NotebookLMClient import os client = NotebookLMClient(auth_json=os.environ.get('NOTEBOOKLM_AUTH_JSON', '')) notebooks = client.notebooks.list() if notebooks: notebook_id = notebooks[0].id result = client.chat.ask(notebook_id, 'What is the summary of this notebook?') print(result.answer)
Debug
Known issues
breakingAuth method changed: 0.3.0+ uses persistent cookie storage (notebooklm auth), not manual cookie passing.
fix
Run 'notebooklm auth check' or use NotebookLMClient(auth_json=...) with the JSON env var.
affects: >=0.3.0
breakingSourceType and ArtifactType moved to notebooklm.models in 0.3.0. Direct top-level import broken.
fix
Change 'from notebooklm import SourceType' to 'from notebooklm.models import SourceType'.
affects: <0.3.0
breakingException hierarchy introduced in 0.3.0; generic exceptions replaced with 'from notebooklm.exceptions import *'.
fix
Catch NotebookLMError from notebooklm.exceptions instead of generic Exception.
affects: <0.3.0
gotchaAll async I/O must run in an event loop; blocking calls from sync context may hang on Windows.
fix
Use async entry points or run with asyncio.run(). For sync cook, ensure ProactorEventLoop compatibility.
affects: <=0.3.4
gotchaCLI conversation ID does not reset when switching notebooks; may cause answers from wrong notebook.
fix
Upgrade to 0.3.2+ or manually clear conversation ID.
affects: <0.3.2
Errors
Common errors & fixes
AttributeError: module 'notebooklm' has no attribute 'NotebookLMClient'
Trying to import NotebookLMClient from wrong location.
fix
Use: from notebooklm import NotebookLMClient
ImportError: cannot import name 'SourceType' from 'notebooklm'
SourceType was moved to notebooklm.models in 0.3.0.
fix
Use: from notebooklm.models import SourceType
RuntimeError: NotebookLMClient must be used inside an asyncio event loop
Attempting to use async client from sync context without event loop.
fix
Wrap code in async function and call with asyncio.run() or use CLI commands.
ValueError: Invalid auth JSON or expired authentication
Auth JSON missing, malformed, or expired.
fix
Run 'notebooklm auth check --test' to validate. Set NOTEBOOKLM_AUTH_JSON env var with fresh token.
Upgrade
Version history
0.3.4latest on PyPI · released Mar 12, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
26
OpenAI (training)
1
Resources
notebooklm-py — pip install notebooklm-py · libregistry