Skip to main content

nbz

Check out the video demo!

nbdev is an incredible software development environment. You write code in notebooks and it exports the result to Python flatfiles. It also handles documentation, version releases, and so much more.

The goal of this project is to do the following, with items 2 and 3 being potential targets for upstream changes to nbdev:

  1. Wrap the nbdev command-line interface with typer to take advantage of some of the features of that framework (formatting, auto-completion, etc)
  2. Enhance the existing CLI documentation
  3. Add new features that may or may not fit in nbdev
  4. Provide an interface for other systems

Developer Guide

If you are new to using nbdev here are some useful pointers to get you started.

Install nbz in Development mode

# make sure nbz package is installed in development mode
$ pip install -e .

# make changes to nbs/core.ipynb
# ...

# compile to have changes apply to nbz

$ nbz export
$ nbz clean
$ nbz trust

Usage

Installation

Install latest from the GitHub repository:

$ pip install git+https://github.com/pydanny/nbz.git

COMING SOON: or from conda

$ conda install -c pydanny nbz

COMING SOON: or from pypi

$ pip install nbz

Documentation

Documentation can be found hosted on this GitHub repository’s pages. Additionally you can find package manager specific guidelines on conda and pypi respectively.

How to use

Once installed, you can call help by typing out nbz at the command-line or !nbz in a notebook cell:

Usage: nbz [OPTIONS] COMMAND [ARGS]...

 nbz is a typer-based wrapper around the incredible nbdev project.

╭─ Options ─────────────────────────────────────────────────────────────────╮
│ --install-completion          Install completion for the current shell.   │
│ --show-completion             Show completion for the current shell, to   │
│                               copy it or customize the installation.      │
│ --help                        Show this message and exit.                 │
╰───────────────────────────────────────────────────────────────────────────╯
╭─ nbdev.release ───────────────────────────────────────────────────────────╮
│ bump-version     Increment version in settings.ini by one                 │
│ changelog        Create a CHANGELOG.md file from closed and labeled       │
│                  GitHub issues                                            │
│ conda            Create a meta.yaml file ready to be built into a         │
│                  package, and optionally build and upload it              │
│ pypi             Create and upload Python package to PyPI                 │
│ release-both     Release both conda and PyPI packages                     │
│ release-gh       Calls nbdev_changelog, lets you edit the result, then    │
│                  pushes to git and calls nbdev_release_git                │
│ release-git      Tag and create a release in GitHub for the current       │
│                  version                                                  │
│ requirements     Writes a requirements.txt file to directory based on     │
│                  settings.ini.                                            │
╰───────────────────────────────────────────────────────────────────────────╯
╭─ nbdev.clean ─────────────────────────────────────────────────────────────╮
│ clean            Clean all notebooks in fname to avoid merge conflicts    │
│ install-hooks    Install Jupyter and git hooks to automatically clean,    │
│                  trust, and fix merge conflicts in notebooks              │
│ trust            Trust notebooks matching fname                           │
╰───────────────────────────────────────────────────────────────────────────╯
╭─ nbdev.config ────────────────────────────────────────────────────────────╮
│ create-config    Create a config file.                                    │
╰───────────────────────────────────────────────────────────────────────────╯
╭─ nbdev.quarto ────────────────────────────────────────────────────────────╮
│ docs             Create Quarto docs and README.md                         │
│ install          Install Quarto and the current library                   │
│ install-quarto   Install latest Quarto on macOS or Linux, prints          │
│                  instructions for Windows                                 │
│ prepare          Export, test, and clean notebooks, and render README if  │
│                  needed                                                   │
│ preview          Preview docs locally                                     │
│ proc-nbs         Process notebooks in path for docs rendering             │
│ readme           Create README.md from readme_nb (index.ipynb by default) │
│ sidebar          Create sidebar.yml                                       │
╰───────────────────────────────────────────────────────────────────────────╯
╭─ nbdev.cli ───────────────────────────────────────────────────────────────╮
│ filter           A notebook filter for Quarto                             │
│ new              Create an nbdev project.                                 │
│ update-license   Allows you to update the license of your project.        │
│ watch-export     Use nb_export on ipynb files in nbs directory on changes │
│                  using nbdev config if available                          │
╰───────────────────────────────────────────────────────────────────────────╯
╭─ nbdev.merge ─────────────────────────────────────────────────────────────╮
│ fix              Create working notebook from conflicted notebook nbname  │
│ merge            Git merge driver for notebooks                           │
╰───────────────────────────────────────────────────────────────────────────╯
╭─ nbdev.migrate ───────────────────────────────────────────────────────────╮
│ migrate          Convert all markdown and notebook files in path from v1  │
│                  to v2                                                    │
╰───────────────────────────────────────────────────────────────────────────╯
╭─ nbdev.test ──────────────────────────────────────────────────────────────╮
│ test             Test in parallel notebooks matching path, passing along  │
│                  flags                                                    │
╰───────────────────────────────────────────────────────────────────────────╯
╭─ nbdev.sync ──────────────────────────────────────────────────────────────╮
│ update           Propagate change in modules matching fname to notebooks  │
│                  that created them                                        │
╰───────────────────────────────────────────────────────────────────────────╯
╭─ Not yet implemented ─────────────────────────────────────────────────────╮
│ export           Not yet implemented                                      │
│ export-cli       Not yet implemented                                      │
╰───────────────────────────────────────────────────────────────────────────╯

To call one of these commands, call it as nbz COMMAND. So to create a new notebook you would type:

mkdir my-project
cd my-project
nbz new

Metadata

Release files for nbz 0.0.2

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

Source distribution (sdist)

Source distribution for nbz 0.0.2
File Size Uploaded Provenance Actions
nbz-0.0.2.tar.gz 16.0 kB Without provenance Details for nbz-0.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 29.2 kB

Release files / nbz-0.0.2.tar.gz

Download URL nbz-0.0.2.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a2907138d40b8a94130e1fa80ffaea12ae176d0cc0f9fff83cf8ecb6906a05a8
BLAKE2b-256 checksum
How to use checksums
1427b2d3ae3792882410bf068817920b47104276d88c1b3a27301ed734aed3a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release files / nbz-0.0.2-py3-none-any.whl

Download URL nbz-0.0.2-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdac8d6262a2f2720ea4bbc7d032b743834e106f61c758d236fe4b57531cfe32
BLAKE2b-256 checksum
How to use checksums
bb7832aa977ed48d265b5c0da14f6d5198c2b69873fe8b594b6759e516d39941
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Security for nbz 0.0.2

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

2 release files 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