Skip to main content

Jupyter notebook verification, compilation, and DAG-based conversion for the SciTeX ecosystem

Project description

SciTeX Notebook (scitex-notebook)

Jupyter notebook verification, compilation, and DAG-based conversion

PyPI version Documentation Tests License: AGPL-3.0


Problem

Jupyter notebooks can be executed in any cell order. The on-disk cell sequence often has no relationship to the actual execution dependency graph. Traditional notebook-to-script converters assume linear order and produce broken scripts.

Solution

scitex-notebook records actual execution order via scitex-clew timestamps, then reconstructs the dependency DAG afterward. "Do what you want, organize later."

  • Verify clew sessions for a notebook (reproducibility check)
  • Check for scitex.io calls missing @scitex.session decoration
  • Compile execution history into a Mermaid DAG or topologically-sorted .py
  • Convert .ipynb to a SciTeX Python script (per-cell or unified main())

Installation

Requires Python >= 3.10.

pip install scitex-notebook

Optional extras:

pip install "scitex-notebook[mcp]"     # MCP server for AI agents
pip install "scitex-notebook[linter]"  # IO-call conversion via scitex-linter
pip install "scitex-notebook[all]"     # everything

Quickstart

Python API
import scitex_notebook as notebook

cells    = notebook.parse_notebook("experiment.ipynb")
issues   = notebook.check_notebook("experiment.ipynb")     # untracked IO
results  = notebook.verify_notebook("experiment.ipynb")    # via clew DB
compiled = notebook.compile_notebook("experiment.ipynb")

print(compiled.to_mermaid())   # Mermaid DAG diagram
print(compiled.to_script())    # DAG-ordered Python script

notebook.convert_notebook(
    "experiment.ipynb",
    output="experiment.py",
    mode="unified",            # or "per_cell"
)
CLI
scitex-notebook verify experiment.ipynb
scitex-notebook check experiment.ipynb
scitex-notebook compile experiment.ipynb --format mermaid
scitex-notebook compile experiment.ipynb --format script -o experiment.py
scitex-notebook convert experiment.ipynb --mode unified -o experiment.py
MCP Server — for AI Agents
Tool Description
notebook_verify Verify clew sessions for a notebook
notebook_check Flag untracked scitex.io calls
notebook_compile Return Mermaid DAG / script / JSON
notebook_convert Convert .ipynb to .py
python -m scitex_notebook.mcp_server

Dependencies

  • Required: scitex-clew — execution-order reconstruction via timestamped sessions.
  • Optional: scitex-linter — advanced IO-call rewriting during conversion.

Part of SciTeX

SciTeX Notebook is part of SciTeX.

The SciTeX system follows the Four Freedoms for Research below, inspired by the Free Software Definition:

Four Freedoms for Research

  1. The freedom to run your research anywhere — your machine, your terms.
  2. The freedom to study how every step works — from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. The freedom to modify any module and share improvements with the community.

AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.

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

scitex_notebook-0.1.0.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

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

scitex_notebook-0.1.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file scitex_notebook-0.1.0.tar.gz.

File metadata

  • Download URL: scitex_notebook-0.1.0.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for scitex_notebook-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fa81b93a34efe68851078edb5eeb15af1ef6d3a5a8fa62766fe44d4f1b61abb6
MD5 4a295f36375b8f5bb45989b38b828def
BLAKE2b-256 6c1ca1ce051200802bcf50d167440c5ab26ead531f36b38285e8cc787e5fd9fd

See more details on using hashes here.

File details

Details for the file scitex_notebook-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: scitex_notebook-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for scitex_notebook-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 784fbc7503d7b1d5c74b4df732647156fad0a21e54a8bd73318f211bc5a06d98
MD5 9ae2abc9446b5f18560e4b9cf16d0c8a
BLAKE2b-256 8e22317dbb3523f4ab65d3ba1e9f7f623cb09b8940d1d147269894932d1f03a6

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