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.2.tar.gz (78.2 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.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

nblm-0.2.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.6 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

nblm-0.2.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded PyPymacOS 10.12+ x86-64

nblm-0.2.2-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.2.2-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.2-cp312-abi3-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: nblm-0.2.2.tar.gz
  • Upload date:
  • Size: 78.2 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.2.tar.gz
Algorithm Hash digest
SHA256 de5c621ec1e4c964fb62b4947678aacdefc002e73e47fb6dd420554bd8d6a1d9
MD5 4d58a8b62129e510d851402d3f21a043
BLAKE2b-256 a852d94985e94f271615c0d0ea7b064bb919aebdd00b3cf9c4adfa181410e8f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.2.2.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.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nblm-0.2.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f023fb6f224c6a8a566ce5457b2363797804d6a6f1fbde1ec77235f9348d1e5e
MD5 87c8819000182ec01f52de7fc37cddfb
BLAKE2b-256 42ee1a09b98f728d44256428261466b45d61a590c3c7ac9d8f9f6dc6dcc35435

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.2.2-pp310-pypy310_pp73-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.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nblm-0.2.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8b88f90e0cc29e112549642a1264c670738a94b285d09d8d7489e865d1621243
MD5 e462004c6cb5a579a0ab61bd2ec6cadf
BLAKE2b-256 28221e7577d338a4cd52c22cc195a4bbfa3e5fee9f3743a83bac035d14593318

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.2.2-pp39-pypy39_pp73-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.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for nblm-0.2.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9a2a5b753da1cda69fb68178fa09d2e8fa496e3826d20272640d3abe654c24d3
MD5 c0970394141716ac0a5288e21d836bc1
BLAKE2b-256 05caccac826e3a3d13be5db2481eb5613ddeecc981932b7917856197bdf1ced9

See more details on using hashes here.

Provenance

The following attestation bundles were made for nblm-0.2.2-pp39-pypy39_pp73-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.

File details

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

File metadata

File hashes

Hashes for nblm-0.2.2-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e23b5f70d3b279d99193c20b1d70626ba52462ba8a094f1c0b3c0ae69899001b
MD5 7049d68c5a7e8870c76484728dcd363e
BLAKE2b-256 cdfb9433154546e813b315bc860610b3e74b156612632c89328cb9362c22061a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nblm-0.2.2-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ade87f775dd1925242ab82cc3f60cd185a5c21142e32af4644f2fa485dba6548
MD5 3c7d6586719a54e26aed4c3f9f8b249a
BLAKE2b-256 7f718643bb9fcebe14a837ff96e688cf11576c903a3443203cf9ab16129894d9

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: nblm-0.2.2-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.2-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4797cb509f5ccacd8876815dd2c287302a6218819c433d959b6fb991f4fb8810
MD5 b85cf84677a2ac601376176535378b1e
BLAKE2b-256 0f2a00f234b7848ddb3fe2082ab959b356f411c44ed406e838112d2e11ab57de

See more details on using hashes here.

Provenance

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

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