Skip to main content

Utility to fix basic notebook validation errors

This project offers a command line tool to fix jupyter notebook files that have some type of validation errors. These errors may happen when editing a notebook in non standard jupyter clients like PyCharm or other editors and they can stop the notebook from being properly processed or displayed in github for example.

Currently the script only deals with one type of error that appears as NotebookValidationError: 'execution_count' is a required property. This error usually happens when a notebook is saved and its last cell has not been executed. As a fix the script will add a key execution_count with a value of null to the cell data if the key is not already present.

By default the script will change the files in place when there is a fix, but you can specify an OUTDIR parameter if you prefer to save output files in a different directory.

Usage

Usage: nbfixme [OPTIONS] [PATH]...

  Utility to fix basic notebook validation errors

  PATH is the path to a notebook file or a
  directory containing *.ipynb files.

  By default the script will change the files in
  place when there is a fix, but you can specify
  an OUTDIR parameter if you prefer to save output
  files in a different directory.

Options:
  -o, --outdir OUTDIR  Save output in directory.
  -c, --check-only     Only check for errors.
  -r, --recurse        Recurse to sub directories.

Example

❯ nbfixme extras -o output
extras/notebook-valid.ipynb ok
extras/notebook-broken.ipynb error
extras/notebook-tofix.ipynb fixed

Installation

You can install the latest version of this module with pip or pipx

pip install git+ssh://git@github.com/furechan/nbfixme.git

-The Jupyter Notebook Format

Metadata

Release files for nbfixme 0.0.1

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

Built distribution (wheel)

Table of built distributions (wheels) for nbfixme 0.0.1
File Interpreter ABI Platform Actions
nbfixme-0.0.1-py3-none-any.whl Python 3 none any Details for nbfixme-0.0.1-py3-none-any.whl

Release files / nbfixme-0.0.1-py3-none-any.whl

Download URL nbfixme-0.0.1-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2b63a43da5889fae9df0b8c8105204add4c9f66f9a9c4c8a06a3a9f07d02167f
BLAKE2b-256 checksum
How to use checksums
a1fbeda882380a4abf115a11b2bb7e94f05e93b67d9495f7d337ca5e55276139
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.12.1

Security for nbfixme 0.0.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.0.1 This release

1 release file No 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