Skip to main content

Python bindings for NotebookLM Enterprise API client

Project description

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"
)

Documentation

Complete Python SDK documentation:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nblm-0.2.1.tar.gz (64.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nblm-0.2.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

nblm-0.2.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

nblm-0.2.1-cp312-abi3-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

nblm-0.2.1-cp312-abi3-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

Details for the file nblm-0.2.1.tar.gz.

File metadata

  • Download URL: nblm-0.2.1.tar.gz
  • Upload date:
  • Size: 64.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nblm-0.2.1.tar.gz
Algorithm Hash digest
SHA256 60fcb2fd492aa4640fe8ab332a71ca71d71e97e3c284ae2f6c83dce5c933b3b9
MD5 052e7e189b2eaa30bf31cf5c254d5432
BLAKE2b-256 6db2d5e134cb662edff1fb399f1342b6ea932d1296a02f8d4e5f2faecaa04019

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.2.1.tar.gz:

Publisher: python-publish.yml on K-dash/nblm-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nblm-0.2.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nblm-0.2.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 98b1d368218feba3b60a7d55a4f7b881db09ea3a8468552b9548f605fc3473a0
MD5 11b761aaf22de75b37bd0edd499a7fb6
BLAKE2b-256 01583a05039d71a7a42f0e6e7eadc00412fd707d21a781c11a070821341fc4e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.2.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: python-publish.yml on K-dash/nblm-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nblm-0.2.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nblm-0.2.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4328cd3ebc17393fdeea29a3f4e10ac3a96175543c9c613ef5b52d29b092ca61
MD5 69d08fe5e4da1b9822272c5a869cfc3f
BLAKE2b-256 757b14173995ba55438f77825410794a3ce3f6b1d2d83232cc7c3e04185ac8fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.2.1-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: python-publish.yml on K-dash/nblm-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nblm-0.2.1-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: nblm-0.2.1-cp312-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.12+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nblm-0.2.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c419cd81efda634b949394d85ff2d37a9f13f5d1d30bad132429f4bed47af205
MD5 41efd41444cbeb16241f080af6f9964d
BLAKE2b-256 5a7705fa4d6d5d4f94b6d063718fc23c007b04e1d7dda254954d7a192a5d1e51

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.2.1-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on K-dash/nblm-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nblm-0.2.1-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for nblm-0.2.1-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8a8e96a3c92a961ae99f697d8faace1772bc0256d8b9421cbdb759d727e899a2
MD5 7471a5f9b73dc3c4d4de583d02ccbe8f
BLAKE2b-256 c8abeb7ff1126ce83b42d73a2396eb10fa3699ac61d8bd2e363e1b9454544986

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.2.1-cp312-abi3-macosx_10_12_x86_64.whl:

Publisher: python-publish.yml on K-dash/nblm-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page