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.4.tar.gz (45.7 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.4-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.4-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.4-cp312-abi3-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

nblm-0.1.4-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.4.tar.gz.

File metadata

  • Download URL: nblm-0.1.4.tar.gz
  • Upload date:
  • Size: 45.7 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.4.tar.gz
Algorithm Hash digest
SHA256 7fc2647249581023b596e8a9da45dceee6324565d3355a008551098fa8a1538a
MD5 4e26ecf33ee53dd7c451fd5e6c47710c
BLAKE2b-256 94f37b4e6602dc00cd0b53ddd80c50e092b2b67ddae144dc0238a5f65bbe291f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nblm-0.1.4-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fcafd503dc56f7efe94c32539a33f7802d4a3b264868cff85c8271dc2adaee14
MD5 fce48a88632d17dd28fe557506acd34a
BLAKE2b-256 0d1ac1d4b4938938264a33e3e59bd7188a5c142705c11e2660eed1363c0d44f5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nblm-0.1.4-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cab78532ad9e7684450641e9a0c461fb08317417b1fbdc1ce47b1daf1e430e1d
MD5 ef26172b34b59d4f48bc25e554b41f64
BLAKE2b-256 754a346d4ee403c374b9368efa8adc13af7b216e83ee1bd67ecb65fa9a3007df

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: nblm-0.1.4-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.4-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5634d2ba45ceafc3744f8b41acf559c695016ff975adccd9510c2bf9bef66c17
MD5 6a5b078189d4633c2cf17bc1293b9c0f
BLAKE2b-256 e612714a3b1b3dca70ae44de14d5c005e77e980a4a855199fc1d7c25b854eff7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nblm-0.1.4-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8b5a79d9f0ec98dff769344ed9c24d092ab311476f5249681105c14cd284a455
MD5 094465de844d2b7c9fb4ee25e2c3d0f5
BLAKE2b-256 7338e770b25cdd7ad80fb536f0865039cc549f01c6783b6562aa982edb8fd008

See more details on using hashes here.

Provenance

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