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 is an unofficial tool and is not affiliated with or endorsed by Google. Use at your own risk.

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.1.3.tar.gz (45.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.1.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

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

nblm-0.1.3-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.1.3-cp312-abi3-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

nblm-0.1.3-cp312-abi3-macosx_10_12_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: nblm-0.1.3.tar.gz
  • Upload date:
  • Size: 45.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.1.3.tar.gz
Algorithm Hash digest
SHA256 67ad8ae754a3a412e1fffc288a4ea7aac5d42c0c238ac57e8c8ca3455cbbce96
MD5 2132367fb61a9dc07b78e23074c8c5a8
BLAKE2b-256 1a262ad631668c3fe55c8a95c383c28f06a17f629daf65b16ba958a604e5e52d

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.1.3.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.1.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nblm-0.1.3-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ceb236b1149525453b4d248d0260a4621bb62e1b6fd3ca19546e081758167146
MD5 f1e0cd5e9e4c5d9ad5ee432203a1a851
BLAKE2b-256 c1bee56bb5d40d1844cbacc2f07fc57dfcc84a0567e55036e056c4ba3fd96a79

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.1.3-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.1.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nblm-0.1.3-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ed38bfbacb316da9b92dd453f591b9e2aacf671348d587e64c5b5b083348952f
MD5 88c07616ca8460651b10882ec47fc2b9
BLAKE2b-256 01521a8eb5b1925ca38f00dff617d7035ab95b4991b857bf9aedb4f1eb015a88

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.1.3-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.1.3-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: nblm-0.1.3-cp312-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.4 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.1.3-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4e7cd2e8f2e0b12d83ec0d2ada4d3961e770680a4f308e84c0f9678d127741fc
MD5 74e9dddb75277b0daa88ed50fce990ab
BLAKE2b-256 72b5e5ee06c2462f200b97d55db891bc8605f1a40cf0bdfd8722bdfa88d294ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.1.3-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.1.3-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for nblm-0.1.3-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 742d5167566fc4b481e22fbf2eb2451b1dbc80e2cf04a9cb017458e34cbe458d
MD5 23ff8bf23729ab57f7dd4020cdcdf9d8
BLAKE2b-256 240b8f66d84a3ca3b88366139fc3a4c5e09ac4628371197e647684bf4d276a2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.1.3-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