Skip to main content

notebook-assistant

PyPI version Python versions License: MIT CI

Bring-your-own-LLM chat assistant for Jupyter notebooks. Load a DataFrame or markdown file, ask questions in plain English, get markdown-rendered answers right in your cell — with the provider you already pay for.

Supports OpenAI, Anthropic, Google Gemini, AWS Bedrock, and any OpenAI-compatible endpoint (e.g. Euron), routed through LiteLLM.

Install

pip install notebook-assistant

For AWS Bedrock also install the bedrock extra (adds boto3):

pip install "notebook-assistant[bedrock]"

Quickstart

Pick a provider, pass your key, ask a question.

OpenAI

from notebook_assistant import NotebookAssistant

assistant = NotebookAssistant(
    model="openai/gpt-4o",
    api_key="sk-...",   # or set OPENAI_API_KEY env var
)
assistant.ask("Give me three exploratory questions for a sales dataset.")

Anthropic

assistant = NotebookAssistant(
    model="anthropic/claude-3-5-sonnet-20241022",
    api_key="sk-ant-...",   # or ANTHROPIC_API_KEY
)

Google Gemini

assistant = NotebookAssistant(
    model="gemini/gemini-1.5-pro",
    api_key="...",   # or GEMINI_API_KEY
)

AWS Bedrock

assistant = NotebookAssistant(
    model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",
    aws_region="ap-south-1",
    # aws_access_key_id / aws_secret_access_key optional — falls back to
    # boto3's standard credential chain (env vars, IAM role, ~/.aws/credentials).
)

You can also pass an inference-profile ARN as the model id.

Euron (OpenAI-compatible)

assistant = NotebookAssistant(
    model="openai/gpt-5.3-instant",
    api_key="...",   # your Euron API key
    api_base="https://api.euron.one/api/v1/euri",
)

Any other OpenAI-compatible endpoint works the same way — pass model="openai/<name>" with a matching api_base.

Loading context

import pandas as pd
from notebook_assistant import NotebookAssistant

df = pd.read_csv("sales.csv")

assistant = NotebookAssistant(model="openai/gpt-4o", api_key="sk-...")
assistant.add_context(
    instructions="Focus on month-over-month trends.",
    dataframes={"sales": df},
    markdown_path="docs/glossary.md",   # optional
)

assistant.ask("Which product saw the steepest decline last quarter?")

add_context accepts any combination of instructions, dataframes, and markdown_path. The content becomes the first user message in the conversation so every follow-up question sees it.

Interactive chat

assistant.chat()   # type 'exit' to quit

Conversation management

assistant.history   # list of {"role", "content"} dicts
assistant.reset()   # clear context and history

Configuration reference

Argument Description
model LiteLLM-style string: <provider>/<model>. See the LiteLLM provider list.
api_key Provider API key. If omitted, LiteLLM reads the provider's standard env var.
api_base Override endpoint — for Euron or self-hosted OpenAI-compatible gateways.
aws_region, aws_access_key_id, aws_secret_access_key, aws_session_token Bedrock-specific credentials. Fall back to the boto3 credential chain.
system_prompt Custom system prompt. Defaults to a data-analysis-focused prompt.
temperature Sampling temperature (default 0.2).
max_tokens Max response tokens (default 2048).
read_timeout Per-request timeout in seconds (default 60).

Examples

Contributing

See CONTRIBUTING.md. Issues and PRs welcome.

License

MIT

Metadata

Release files for notebook-assistant 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for notebook-assistant 0.2.0
File Size Uploaded Provenance
notebook_assistant-0.2.0.tar.gz 14.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for notebook-assistant 0.2.0
File Interpreter ABI Platform
notebook_assistant-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.8 kB

Release files / notebook_assistant-0.2.0.tar.gz

Download URL notebook_assistant-0.2.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
b36166c05401c40200b6a96c430cc0082e8631a62e14372f6f9f81a70a7db1cd
BLAKE2b-256 checksum
How to use checksums
33e6747d2444b664c1625ff178ba1a817c08f0dcdaa76a574ff327fe163f8621
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 19, 2026.

Transparency log

Release files / notebook_assistant-0.2.0-py3-none-any.whl

Download URL notebook_assistant-0.2.0-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34c431d8ab6278e178368677f8ef6aa344c80b0f16ca00f40eb3e4bd4d7d7d9e
BLAKE2b-256 checksum
How to use checksums
7ba219629b1343d2b9d9f1b997ae0fa6575b99c3a209899b6641eca98306c6d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 19, 2026.

Transparency log

Security for notebook-assistant 0.2.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for notebook_assistant-0.2.0.tar.gz

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 Apr 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page