notebooklm
VerifiedInstall, authenticate, troubleshoot, and operate Gemini Notebook through the notebooklm-py CLI or typed async Python API. Use for notebook and source management, grounded chat and research, and artifact generation or download when the user mentions Gemini Notebook, notebooklm-py, the notebooklm CLI, or its Python API. Do not use for the generic Gemini API or unrelated content creation.
examples/quickstart.py
View on GitHub#!/usr/bin/env python3
"""Quickstart example for notebooklm-py.
This script demonstrates a complete workflow:
1. Create a notebook
2. Add sources
3. Chat with content
4. Generate a podcast
5. Download the result
Prerequisites:
pip install "notebooklm-py[browser]" && playwright install chromium
notebooklm login # Authenticate first
# Full install guide: https://github.com/teng-lin/notebooklm-py/blob/main/docs/installation.md
Usage:
python quickstart.py
"""
import asyncio
from notebooklm import NotebookLMClient
async def main():
print("=== NotebookLM Quickstart ===\n")
async with NotebookLMClient.from_storage() as client:
# 1. Create a notebook
print("Creating notebook...")
nb = await client.notebooks.create("Quickstart Demo")
print(f" Created: {nb.id} - {nb.title}\n")
# 2. Add a source
print("Adding source...")
url = "https://en.wikipedia.org/wiki/Artificial_intelligence"
source = await client.sources.add_url(nb.id, url)
print(f" Added: {source.title}\n")
# 3. Chat with the content
print("Asking a question...")
result = await client.chat.ask(nb.id, "What are the main topics covered?")
print(f" Answer: {result.answer[:200]}...\n")
# 4. Generate an audio overview
print("Generating podcast (this may take a few minutes)...")
status = await client.artifacts.generate_audio(
nb.id, instructions="Focus on the history and key milestones"
)
print(f" Started generation, task_id: {status.task_id}")
# Wait for completion
final = await client.artifacts.wait_for_completion(
nb.id, status.task_id, timeout=300, initial_interval=10
)
if final.is_complete:
print(f" Complete! URL: {final.url}\n")
# 5. Download (requires browser support)
# output_path = await client.artifacts.download_audio(nb.id, "./podcast.m4a")
# print(f" Downloaded to: {output_path}")
else:
print(f" Generation status: {final.status}\n")
# Cleanup: Delete the demo notebook
print("Cleaning up...")
await client.notebooks.delete(nb.id)
print(" Deleted demo notebook\n")
print("=== Done! ===")
if __name__ == "__main__":
asyncio.run(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |