Skip to main content

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

Project description

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

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

nbz-0.0.2.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

nbz-0.0.2-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file nbz-0.0.2.tar.gz.

File metadata

  • Download URL: nbz-0.0.2.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for nbz-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a2907138d40b8a94130e1fa80ffaea12ae176d0cc0f9fff83cf8ecb6906a05a8
MD5 531ebd405e66457a7ab858dee0a35412
BLAKE2b-256 1427b2d3ae3792882410bf068817920b47104276d88c1b3a27301ed734aed3a5

See more details on using hashes here.

File details

Details for the file nbz-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: nbz-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for nbz-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fdac8d6262a2f2720ea4bbc7d032b743834e106f61c758d236fe4b57531cfe32
MD5 0517dd55cca7c7a124519b66035af46d
BLAKE2b-256 bb7832aa977ed48d265b5c0da14f6d5198c2b69873fe8b594b6759e516d39941

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