cli

CLI commands

source

nbdev_filter


def nbdev_filter(
    nb_txt:str=None, # Notebook text (uses stdin if not provided)
    fname:str=None, # Notebook to read (uses `nb_txt` if not provided)
    printit:bool_arg=True, # Print to stdout?
):

A notebook filter for Quarto


source

extract_tgz


def extract_tgz(
    url, dest:str='.'
):

source

nbdev_new


def nbdev_new(
    repo:str=None, # Repo name
    branch:str=None, # Repo default branch
    user:str=None, # Repo username
    author:str=None, # Package author's name
    author_email:str=None, # Package author's email address
    description:str=None, # Short summary of the package
    path:str='.', # Path to create config file
    cfg_name:str='settings.ini', # Name of config file to create
    lib_name:str='%(repo)s', # Package name
    git_url:str='https://github.com/%(user)s/%(repo)s', # Repo URL
    custom_sidebar:bool_arg=False, # Use a custom sidebar.yml?
    nbs_path:Path='nbs', # Path to notebooks
    lib_path:Path=None, # Path to package root (default: `repo` with `-` replaced by `_`)
    doc_path:Path='_docs', # Path to rendered docs
    tst_flags:str='notest', # Test flags
    version:str='0.0.1', # Version of this release
    doc_host:str='https://%(user)s.github.io', # Hostname for docs
    doc_baseurl:str='/%(repo)s', # Base URL for docs
    keywords:str='nbdev jupyter notebook python', # Package keywords
    license:str='apache2', # License for the package
    copyright:str=None, # Copyright for the package, defaults to '`current_year` onwards, `author`'
    status:str='3', # Development status PyPI classifier
    min_python:str='3.9', # Minimum Python version PyPI classifier
    audience:str='Developers', # Intended audience PyPI classifier
    language:str='English', # Language PyPI classifier
    recursive:bool_arg=True, # Include subfolders in notebook globs?
    black_formatting:bool_arg=False, # Format libraries with black?
    readme_nb:str='index.ipynb', # Notebook to export as repo readme
    title:str='%(lib_name)s', # Quarto website title
    allowed_metadata_keys:str='', # Preserve the list of keys in the main notebook metadata
    allowed_cell_metadata_keys:str='', # Preserve the list of keys in cell level metadata
    jupyter_hooks:bool_arg=False, # Run Jupyter hooks?
    clean_ids:bool_arg=True, # Remove ids from plaintext reprs?
    clear_all:bool_arg=False, # Remove all cell metadata and cell outputs?
    cell_number:bool_arg=True, # Add cell number to the exported file
    put_version_in_init:bool_arg=True, # Add the version to the main __init__.py in nbdev_export
    update_pyproject:bool_arg=True, # Create/update pyproject.toml with correct project name
    skip_procs:str='', # A comma-separated list of processors that you want to skip
):

Create an nbdev project.

It works by copying contents from the latest tagged nbdev-template release, and rendering termplate variables using the created settings.ini file. Settings can be passed via command line args; missing settings are inferred from the current git/GitHub repo, otherwise prompted for.


source

nbdev_update_license


def nbdev_update_license(
    to:str=None, # update license to
):

Allows you to update the license of your project.


source

nb_export_cli


def nb_export_cli(
    nbname, debug:store_true=False, # Debug flag
    lib_path:str=None, # Path to destination library.  If not in a nbdev project, defaults to current directory.
    name:str=None, # Name of python script {name}.py to create.
    solo_nb:bool=False, # Export single notebook outside of an nbdev project.
):

Export a single nbdev notebook to a python script.


source

watch_export


def watch_export(
    nbs:str=None, # Nb directory to watch for changes
    lib:str=None, # Export directory to write py files to
    force:bool=False, # Ignore nbdev config if in nbdev project
):

Use nb_export on ipynb files in nbs directory on changes using nbdev config if available

Help


source

chelp


def chelp(
    
):

Show help for all console scripts

chelp()
nb_export                 Export a single nbdev notebook to a python script.

nbdev_bump_version        Increment version in settings.ini by one

nbdev_changelog           Create a CHANGELOG.md file from closed and labeled GitHub issues

nbdev_clean               Clean all notebooks in `fname` to avoid merge conflicts

nbdev_conda               Create a `meta.yaml` file ready to be built into a package, and optionally build and upload it

nbdev_contributing        Create CONTRIBUTING.md from contributing_nb (defaults to 'contributing.ipynb' if present). Skips if the file doesn't exist.

nbdev_create_config       Create a config file.

nbdev_docs                Create Quarto docs and README.md

nbdev_export              Export notebooks in `path` to Python modules

nbdev_filter              A notebook filter for Quarto

nbdev_fix                 Create working notebook from conflicted notebook `nbname`

nbdev_help                Show help for all console scripts

nbdev_install             Install Quarto and the current library

nbdev_install_hooks       Install Jupyter and git hooks to automatically clean, trust, and fix merge conflicts in notebooks

nbdev_install_quarto      Install latest Quarto on macOS or Linux, prints instructions for Windows

nbdev_merge               Git merge driver for notebooks

nbdev_migrate             Convert all markdown and notebook files in `path` from v1 to v2

nbdev_new                 Create an nbdev project.

nbdev_prepare             Export, test, and clean notebooks, and render README if needed

nbdev_preview             Preview docs locally

nbdev_proc_nbs            Process notebooks in `path` for docs rendering

nbdev_pypi                Create and upload Python package to PyPI

nbdev_readme              Create README.md from readme_nb (index.ipynb by default)

nbdev_release_both        Release both conda and PyPI packages

nbdev_release_gh          Calls `nbdev_changelog`, lets you edit the result, then pushes to git and calls `nbdev_release_git`

nbdev_release_git         Tag and create a release in GitHub for the current version

nbdev_requirements        Writes a `requirements.txt` file to `directory` based on settings.ini.

nbdev_sidebar             Create sidebar.yml

nbdev_test                Test in parallel notebooks matching `path`, passing along `flags`

nbdev_trust               Trust notebooks matching `fname`

nbdev_update              Propagate change in modules matching `fname` to notebooks that created them

nbdev_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