Notebook Publish Check
Keep useful figures. Review risky output. Publish a separate copy.
A dependency-free, non-executing publication review tool for Jupyter notebooks. Generate a local HTML preview, inspect cell-level findings, choose which outputs or metadata to remove, and download a separate notebook.
Notebook公開前に、セルごとの点検結果を確認し、残す図と削除する出力を選べます。元ファイルは変更しません。
Install from PyPI / pipでインストール
Python 3.10 or later. Create and activate a virtual environment first:
python3 -m venv .venv
macOS / Linux: source .venv/bin/activate
Windows PowerShell: .venv\Scripts\Activate.ps1
python -m pip install notebook-publish-check
nbpublish --help
The help screen confirms that the command is available. Install only the tools you need. PyPI package · Source and examples
サンプルCSV・Notebookなどはpipでは配置されません。公開デモはブラウザで開けます。自分でサンプルを実行する場合はGitHubの「Code → Download ZIP」で取得・展開し、READMEの相対パスをそのフォルダー内から指定してください。
Article & live demo / 紹介記事と公開デモ
- 個別ガイド / Notebook Publish Check:公開前に出力を選んで整理する
- 紹介記事:データを分ける・評価する・公開する。Pythonの小さな確認ツールを3つ作りました — Japanese overview of SplitTrace, EventScore Explorer, and Notebook Publish Check.
- 公開デモをブラウザで開く / Open the live demo — Synthetic data only; no installation required.
公開デモは合成データの出力例です。自分のファイルをアップロードする画面ではありません。 The hosted demo is a sample report, not a file-upload service.
Try the demo
Download and open examples/demo.html. The sample uses synthetic logs and clearly fake credentials. Keep the figure in cell 2, remove outputs in cell 3, and inspect the warning in cell 4: deleting outputs does not remove a credential-like value from source code.
python3 -m venv .venv
. .venv/bin/activate
python -m pip install .
nbpublish examples/publication-demo.ipynb --output reports/review.html --json reports/findings.json
Without installation: PYTHONPATH=src python3 -m notebook_publish_check followed by the same arguments.
Python 3.10+. No runtime dependencies.
Exit codes: 0 no selected findings; 1 findings for review (report successfully created); 2 invalid input or I/O error. No findings does not mean a notebook is safe to publish.
Workflow
- Generate the local report; code is never executed.
- Inspect source, text output, raster images, and findings. HTML/SVG/JavaScript outputs are shown as text, never executed.
- Select output or metadata removal per cell. Selecting outputs clears the entire cell output and its execution count. It does not edit individual values.
- Download
reviewed-copy.ipynb; the original is unchanged. Manually edit flagged source code when necessary. - Re-run the checker on the downloaded copy, then review remaining content before publishing.
Checks and coverage
- Credential-like assignments (
api_key,access_token,password,secret) and selected token prefixes; heuristic, with false positives and false negatives. - Selected Unix/macOS/Windows home-directory absolute paths.
- Large serialized cell outputs (100,000 UTF-8 bytes by default; change with
--max-output-kb). - Rich outputs and embedded attachments marked for manual review.
- Notebook/cell metadata and textual attachments inspected for the same selected patterns.
The HTML report embeds the original notebook, including values omitted from the findings summary. Keep reports private. JSON findings omit matched values but may include metadata key names. Images are not OCR-scanned; binary attachments, arbitrary personal information, encoded/obfuscated secrets and Git history are not comprehensively checked. Source and attachments are preserved in exported copies. Metadata removal may remove tags, kernel info or presentation settings.
This is not a replacement for Gitleaks, nbstripout or nbdime. The focus is a publication review workflow with selective output retention.
Python API and development
scan(notebook) returns cell-indexed findings (indices are zero-based). sanitize(notebook, remove_outputs=[2], remove_metadata=[2, 'notebook']) returns a deep copy, leaving the input intact.
PYTHONPATH=src python3 -m unittest discover -s tests -v
Experimental 0.1, nbformat 4 only, 20 MB input limit. Basic structure checks are not a full nbformat schema validator. Output files must be new and cannot overwrite inputs. No telemetry or external services. MIT licensed.
Metadata
Release files for notebook-publish-check 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| notebook_publish_check-0.1.0.tar.gz | 20.6 kB | With provenance | Details for notebook_publish_check-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| notebook_publish_check-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for notebook_publish_check-0.1.0-py3-none-any.whl |
Total release size: 31.9 kB
Release files / notebook_publish_check-0.1.0.tar.gz
| Download URL | notebook_publish_check-0.1.0.tar.gz |
|---|---|
| Size | 20.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24cd4c254d38c6556e282d3e7ec0e349c288b92f536bc9b85c9dbb2e9cf2705f
|
|
BLAKE2b-256 checksum How to use checksums |
e2bc663b62df8cc9a532d5821584b65f49b4360933ce506f5ed4821747f47640
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 9, 2026.
Transparency logRelease files / notebook_publish_check-0.1.0-py3-none-any.whl
| Download URL | notebook_publish_check-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0847bd72a64efb2de0d5577357cbcca279caa4d648883b08d3e080f93510fb71
|
|
BLAKE2b-256 checksum How to use checksums |
87a5ed3c641ad2322583ff05cf0a0ef78267c2f431dfd49cfcb5551351077695
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 9, 2026.
Transparency logSecurity for notebook-publish-check 0.1.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
Both files in this release have been uploaded with provenance metadata.
Attestation for notebook_publish_check-0.1.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 Nov 9, 2026.
Transparency logA 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.