nbdev is a Python library that enables a complete literate programming environment, allowing users to develop, test, document, and deploy software using Jupyter Notebooks. It leverages Quarto for powerful documentation generation and provides a robust command-line interface for managing the development workflow. Currently at version 3.0.15, nbdev maintains a rapid release cadence, frequently pushing minor updates and bug fixes.
pip install nbdevVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the typical nbdev CLI workflow: creating a new project, exporting notebook code to Python modules, running tests, and generating documentation. Remember to manually create/edit a notebook file with '#|export' cells before running `nbdev_export`.
Review the official nbdev v3 migration guide. Update CLI commands (e.g., `nbdev_build_lib` -> `nbdev_export`), refactor configuration, and adjust project structure.
Update notebook frontmatter to the new Quarto-compatible format. Consult the nbdev documentation for the correct syntax.
Always run `nbdev_install_hooks` in the root of your nbdev project. This sets up git hooks to automatically clean notebooks on commit.
Download and install the Quarto CLI from the official Quarto website (quarto.org) for your operating system.
Ensure nbdev is installed using `pip install nbdev`. If using a virtual environment, activate it before running commands. You may need to restart your terminal.
Run `nbdev_export` from your project's root directory. Ensure your notebook contains cells marked `#|export` and that your `pyproject.toml` (or `settings.py`) correctly defines `lib_name`.
Download and install the Quarto CLI from https://quarto.org/docs/get-started/ for your operating system. Ensure it's added to your system's PATH.
Navigate to your project root and run `nbdev_install_hooks`. If the problem persists, manually check your `.git/hooks` directory or re-initialize git if safe to do so.