nblm - Python SDK for NotebookLM Enterprise API
Python bindings for the NotebookLM Enterprise API, powered by Rust via PyO3.
Warning: This project is not affiliated with, sponsored, or endorsed by Google. nblm-rs is an independent, unofficial tool. It is provided "as is" without any warranty.
Installation
pip install nblm
Or with uv:
uv add nblm
Requirements: Python 3.14 or later
Quick Start
from nblm import NblmClient, GCloudTokenProvider
# Initialize client
client = NblmClient(
token_provider=GCloudTokenProvider(),
project_number="123456789012"
)
# Create a notebook
notebook = client.create_notebook("My Notebook")
print(f"Created: {notebook.title}")
# Add sources
from nblm import WebSource
client.add_sources(
notebook_id=notebook.notebook_id,
web_sources=[WebSource(url="https://example.com", name="Example")]
)
# Create audio overview
audio = client.create_audio_overview(notebook.notebook_id)
print(f"Audio status: {audio.status}")
Features
- Notebooks: Create, list, and delete notebooks
- Sources: Add web, text, video sources; upload files; manage sources
- Audio Overviews: Create podcast-style discussions from notebook content
- Type Safety: Full type hints for IDE autocomplete and static analysis
- Fast: Powered by Rust for high performance
Authentication
gcloud CLI (Recommended)
from nblm import NblmClient, GCloudTokenProvider
client = NblmClient(
token_provider=GCloudTokenProvider(),
project_number="123456789012"
)
Environment Variable
import os
from nblm import NblmClient, EnvTokenProvider
os.environ["NBLM_ACCESS_TOKEN"] = "your-access-token"
client = NblmClient(
token_provider=EnvTokenProvider(),
project_number="123456789012"
)
OAuth2 (Read-only)
Experimental: OAuth2 support currently requires setting
NBLM_PROFILE_EXPERIMENT=1. Users must create an OAuth 2.0 Desktop application client ID in Google Cloud Console, including the client secret, before running this flow.
First, run the CLI once to complete the browser flow and store a refresh token:
export NBLM_OAUTH_CLIENT_ID="123-abc.apps.googleusercontent.com"
export NBLM_OAUTH_CLIENT_SECRET="your-desktop-client-secret"
export NBLM_PROFILE_EXPERIMENT=1
nblm --auth user-oauth --project-number 123456 notebooks list
Then reuse that token from Python without re-authenticating:
from nblm import NblmClient
client = NblmClient.with_user_oauth(
project_number=123456,
location="us-central1",
)
You can also instantiate the provider directly:
from nblm import UserOAuthProvider
provider = UserOAuthProvider.from_file(project_number=123456)
Documentation
Complete Python SDK documentation:
- Getting Started Guide
- Quickstart Tutorial
- API Reference
- Notebooks API
- Sources API
- Audio API
- Error Handling
Examples
Create Notebook and Add Sources
from nblm import NblmClient, GCloudTokenProvider, WebSource, TextSource
client = NblmClient(
token_provider=GCloudTokenProvider(),
project_number="123456789012"
)
# Create notebook
notebook = client.create_notebook("Research: Python Best Practices")
# Add sources
client.add_sources(
notebook_id=notebook.notebook_id,
web_sources=[
WebSource(url="https://peps.python.org/pep-0008/", name="PEP 8"),
WebSource(url="https://docs.python-guide.org/")
],
text_sources=[
TextSource(content="Focus on code quality", name="Notes")
]
)
Upload Files
# Upload a PDF
response = client.upload_source_file(
notebook_id=notebook.notebook_id,
path="/path/to/document.pdf",
display_name="Research Paper"
)
print(f"Uploaded: {response.source_id}")
Error Handling
from nblm import NblmError
try:
notebook = client.create_notebook("My Notebook")
except NblmError as e:
print(f"Error: {e}")
Type Hints
The library includes full type hints:
from nblm import (
NblmClient,
Notebook,
NotebookSource,
AudioOverviewResponse,
WebSource,
TextSource,
VideoSource,
)
# All operations are fully typed
client: NblmClient
notebook: Notebook = client.create_notebook("Title")
audio: AudioOverviewResponse = client.create_audio_overview("abc123")
Supported Operations
| Category | Operations | Status |
|---|---|---|
| Notebooks | Create, list, delete | Available |
| Sources | Add (web, text, video), upload files, get, delete | Available |
| Audio Overview | Create, delete | Available |
| Sharing | Share with users | Not available |
Links
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT
Metadata
Release files for nblm 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nblm-0.2.3.tar.gz | 84.1 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| nblm-0.2.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | PyPy 3.10 | PyPy 3.10 7.3 | Linux glibc 2.17+ ARM64 | Details |
| nblm-0.2.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | PyPy 3.9 | PyPy 3.9 7.3 | Linux glibc 2.17+ ARM64 | Details |
| nblm-0.2.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl | PyPy 3.9 | PyPy 3.9 7.3 | macOS 10.12+ x86-64 | Details |
| nblm-0.2.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| nblm-0.2.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| nblm-0.2.3-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 16.6 MB
Release files / nblm-0.2.3.tar.gz
| Download URL | nblm-0.2.3.tar.gz |
|---|---|
| Size | 84.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d6c2273f4076fa05b8e67e39e5567b64846581e5069ac6a50d86abd36386677
|
|
BLAKE2b-256 checksum How to use checksums |
a14c543a6f5c52d8fdfe7a6120f9b220c8847718880828548b94b7680074abc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.
Transparency logRelease files / nblm-0.2.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nblm-0.2.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | Linux glibc 2.17+ ARM64 PyPy 3.10 PyPy 3.10 7.3 |
|
SHA-256 checksum How to use checksums |
0bf943e2e922caf95228fe6fe3d0d1aebd4195596743ecd97fe37ed2d58f2836
|
|
BLAKE2b-256 checksum How to use checksums |
dd5d5d8ad2b187d62d3c98e7c9fae2b842c26ec34e7b0185538ea90879df8790
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.
Transparency logRelease files / nblm-0.2.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nblm-0.2.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | Linux glibc 2.17+ ARM64 PyPy 3.9 PyPy 3.9 7.3 |
|
SHA-256 checksum How to use checksums |
35954bd906ec10b9d96c23e7d2d6a8b176d27bfdff2562e5370db0ebd65844e0
|
|
BLAKE2b-256 checksum How to use checksums |
6cae2b88a46010c129d7b360395ee41dbc66239bf24ea98b1a11d56dda4e65f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.
Transparency logRelease files / nblm-0.2.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl
| Download URL | nblm-0.2.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | PyPy 3.9 PyPy 3.9 7.3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c4c35dc8753fff2f7bf5e430f50f0fe23f37ffee7648686b8e15248545414d95
|
|
BLAKE2b-256 checksum How to use checksums |
ce9a7ea3b6561edff06f9237f34597a98125b1a170872ad35e2802b302d26bfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.
Transparency logRelease files / nblm-0.2.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | nblm-0.2.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
07e0bcf07f57eb4e5f917eb5cc8ad68e812de05dc02d085a1de276ac881244fb
|
|
BLAKE2b-256 checksum How to use checksums |
09c13361c12505c4c6ffd9a07117ef253e8dc650845065d30d7e4552c32b3217
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.
Transparency logRelease files / nblm-0.2.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | nblm-0.2.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.8 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
5a38d53424bb1a48a70f318cb8e78fb222dcead4ed79d9cecc390013bb5835d0
|
|
BLAKE2b-256 checksum How to use checksums |
66b4704d6dd0c8b6712ae74eec3c843ef978bb5301e9ca699aa3f04f9c8c5922
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.
Transparency logRelease files / nblm-0.2.3-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | nblm-0.2.3-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6e0de3865a33e3a4ce679f654ee248a26b49b2aa730dfaf12de44e695bd15ae7
|
|
BLAKE2b-256 checksum How to use checksums |
ee3e3304c49f6a1512081afcfefc38502c423bcf0749ab561be0d01a620a4110
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2025.
Transparency log