Skip to main content

Configuration

The nbdev configuration file

All of nbdev’s configuration is done through your pyproject.toml file, which lives in the root of your repo. Standard project metadata goes in the [project] section (following PEP 621), while nbdev-specific settings go in [tool.nbdev]. For example, here’s a snippet from nbdev’s own pyproject.toml:

[DEFAULT]
lib_name = nbdev
repo = nbdev
description = Create delightful software with Jupyter Notebooks
copyright = 2020 onwards, Jeremy Howard
keywords = nbdev fastai jupyter notebook export
user = fastai
author = Jeremy Howard and Hamel Husain
author_email = [email protected]
branch = master

You can create this file with nbdev-create-config (which sets it up for you based on git/GitHub repo settings), or with nbdev-new (which creates a complete new project). Here are all of nbdev’s settings for nbdev-create-config:

Type Default Details
repo str None Repo name
branch str main 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 Short summary of the package
path str . Path to create config file
min_python str 3.10 Minimum Python version
license str Apache-2.0 License (SPDX identifier)

You can customise nbdev for all repositories for your user with a ~/.config/nbdev/config.toml file.

In order for Git actions to run smoothly, add dependencies in [project].dependencies in your pyproject.toml.

See nbdev’s pyproject.toml as a reference.