Skip to main content

Export Jupyter notebooks into narrated, cell-labeled text.

Project description

Neurobyte

Export Jupyter notebooks into narrated, cell-labeled text for LLM contexts.

Features

  • Clean Export: Extracts code cells from .ipynb files.
  • Narrative Summary: Generates a header paragraph summarizing the code's intent.
  • Neurobyte Outline: Adds a structured outline with markdown headers.
  • Redaction: Automatically redacts sensitive patterns (API keys, BQ table IDs).
  • JSON Output: Machine-readable format for indexing and search.
  • Markdown Cells: Include # headers in the outline.
  • Custom Redaction: Add your own regex patterns.
  • Cell Selection: Export specific cell ranges.

Installation

pip install neurobyte

Usage

CLI

# Basic export
python -m neurobyte export notebook.ipynb

# Specify output file
python -m neurobyte export notebook.ipynb -o summary.txt

# JSON output
python -m neurobyte export notebook.ipynb --json

# Include markdown cells
python -m neurobyte export notebook.ipynb --include-markdown

# Custom redaction pattern
python -m neurobyte export notebook.ipynb --redact-pattern 'client_id=\d+'

# Export specific cells
python -m neurobyte export notebook.ipynb --cells 1-5

# Disable redaction
python -m neurobyte export notebook.ipynb --no-redact

Python API

import neurobyte as nb
from neurobyte.export import ExportOptions

# Basic export
nb.export_notebook("notebook.ipynb", "export.txt")

# With options
opts = ExportOptions(
    output_format="json",
    include_markdown=True,
    redact_secrets=True,
    extra_redact_patterns=["client_id=\\d+"],
    cell_indices=[1, 2, 3],
)
nb.export_notebook("notebook.ipynb", "export.json", options=opts)

# Export from live session (requires IPython)
nb.export_here("session.txt")

Development

This project uses make for common development tasks.

# Install dependencies
make install

# Run tests (Pytest)
make test

# Linting & Formatting (Ruff, Black, Mypy)
make lint
make format

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

neurobyte-0.2.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

neurobyte-0.2.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file neurobyte-0.2.0.tar.gz.

File metadata

  • Download URL: neurobyte-0.2.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for neurobyte-0.2.0.tar.gz
Algorithm Hash digest
SHA256 618ff7508d8274837ee5903f8e9df639bc42086ed58dc75a883198c55e48c95e
MD5 8b5741664d4dbc4ccf047689f1e93c69
BLAKE2b-256 b6ed4b09875f14b602d3be9af95159606ba8e325bff63b015da710e3609d77db

See more details on using hashes here.

File details

Details for the file neurobyte-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: neurobyte-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for neurobyte-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6832a2376f2ae62771935550eee03896ea1e1012921219e57efc8efd3edfe2c
MD5 362a2d622aec30e6ef3a909fb53b08d2
BLAKE2b-256 6dcf2d5342e3459088350387ba8390e9ac75eac84aa383db2880cafb8a2556b7

See more details on using hashes here.

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