Settings.ini

The nbdev configuration file

All of nbdev’s configuration is done through a file called settings.ini which lives in the root of your repo. It’s in ConfigParser format. For example, here’s the first few lines of nbdev’s settings.ini file

[DEFAULT]
lib_name = 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
min_python = 3.7

You can create this file with nbdev_create_config (in which case you pass the settings manually), or with nbdev_new (which sets it up automatically for you from your repo settings). Here are all of nbdev’s settings (excluding the path and cfg_name parameters which decide where the config file is saved):

Type Default Details
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.7 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 True 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?
put_version_in_init bool_arg True Add the version to the main init.py in nbdev_export

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