• Stars
    star
    4,693
  • Rank 8,576 (Top 0.2 %)
  • Language
    Jupyter Notebook
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Create delightful software with Jupyter Notebooks

Getting Started

CI

nbdev is a notebook-driven development platform. Simply write notebooks with lightweight markup and get high-quality documentation, tests, continuous integration, and packaging for free!

nbdev makes debugging and refactoring your code much easier than in traditional programming environments since you always have live objects at your fingertips. nbdev also promotes software engineering best practices because tests and documentation are first class.

  • Documentation is automatically generated using Quarto and hosted on GitHub Pages. Docs support LaTeX, are searchable, and are automatically hyperlinked (including out-of-the-box support for many packages via nbdev-index)
  • Publish packages to PyPI and conda as well as tools to simplify package releases. Python best practices are automatically followed, for example, only exported objects are included in __all__
  • Two-way sync between notebooks and plaintext source code allowing you to use your IDE for code navigation or quick edits
  • Tests written as ordinary notebook cells are run in parallel with a single command
  • Continuous integration out-of-the-box with GitHub Actions that run your tests and rebuild your docs
  • Git-friendly notebooks with Jupyter/Git hooks that clean unwanted metadata and render merge conflicts in a human-readable format
  • … and much more!

Install

nbdev works on macOS, Linux, and most Unix-style operating systems. It works on Windows under WSL, but not under cmd or Powershell.

You can install nbdev with pip:

pip install nbdev

… or with conda (or mamba):

conda install -c fastai nbdev

Note that nbdev must be installed into the same Python environment that you use for both Jupyter and your project.

How to use nbdev

The best way to learn how to use nbdev is to complete either the written walkthrough or video walkthrough:

Alternatively, there’s a shortened version of the video walkthrough with coding sections sped up using the unsilence Python library – it’s 27 minutes faster, but a bit harder to follow.

You can also run nbdev_help from the terminal to see the full list of available commands:

!nbdev_help
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_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_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

FAQ

Q: What is the warning “Found a cell containing mix of imports and computations. Please use separate cells”?

A: You should not have cells that are not exported, and contain a mix of import statements along with other code. For instance, don’t do this in a single cell:

import some_module
some_module.something()

Instead, split this into two cells, one which does import some_module, and the other which does some_module.something().

The reason for this is that when we create your documentation website, we ensure that all of the signatures for functions you document are up to date, by running the imports, exported cells, and show_doc functions in your notebooks. When you mix imports with other code, that other code will be run too, which can cause errors (or at least slowdowns) when creating your website.

Q: Why is nbdev asking for root access? How do I install Quarto without root access?

A: When you setup your first project, nbdev will attempt to automatically download and install Quarto for you. This is the program that we use to create your documentation website.

Quarto’s standard installation process requires root access, and nbdev will therefore ask for your root password during installation. For most people, this will work fine and everything will be handled automatically – if so, you can skip over the rest of this section, which talks about installing without root access.

If you need to install Quarto without root access on Linux, first cd to wherever you want to store it, then download Quarto, and type:

dpkg -x quarto*.deb .
mv opt/quarto ./
rmdir opt
mkdir -p ~/.local/bin
ln -s "$(pwd)"/quarto/bin/quarto ~/.local/bin

To use this non-root version of Quarto, you’ll need ~/.local/bin in your PATH environment variable. (Alternatively, change the ln -s step to place the symlink somewhere else in your path.)

Q: Someone told me not to use notebooks for “serious” software development!

A: Watch this video. Don’t worry, we still get this too, despite having used nbdev for a wide range of “very serious” software projects over the last three years, including deep learning libraries, API clients, Python language extensions, terminal user interfaces, and more!

Contributing

If you want to contribute to nbdev, be sure to review the contributions guidelines. This project adheres to fastai’s code of conduct. By participating, you are expected to uphold this code. In general, we strive to abide by generally accepted best practices in open-source software development.

Make sure you have nbdev’s git hooks installed by running nbdev_install_hooks in the cloned repository.

Copyright

Copyright © 2019 onward fast.ai, Inc. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this project’s files except in compliance with the License. A copy of the License is provided in the LICENSE file in this repository.

More Repositories

1

fastai

The fastai deep learning library
Jupyter Notebook
25,566
star
2

fastbook

The fastai book, published as Jupyter Notebooks
Jupyter Notebook
20,274
star
3

numerical-linear-algebra

Free online textbook of Jupyter notebooks for fast.ai Computational Linear Algebra course
Jupyter Notebook
9,897
star
4

courses

fast.ai Courses
Jupyter Notebook
5,508
star
5

course-v3

The 3rd edition of course.fast.ai
Jupyter Notebook
4,895
star
6

fastpages

An easy to use blogging platform, with enhanced support for Jupyter Notebooks.
Jupyter Notebook
3,520
star
7

course-nlp

A Code-First Introduction to NLP course
Jupyter Notebook
3,380
star
8

course22

The fast.ai course notebooks
Jupyter Notebook
1,984
star
9

lm-hackers

Hackers' Guide to Language Models
Jupyter Notebook
1,434
star
10

fastprogress

Simple and flexible progress bar for Jupyter Notebook and console
Jupyter Notebook
1,074
star
11

fastcore

Python supercharged for the fastai library
Jupyter Notebook
894
star
12

imagenette

A smaller subset of 10 easily classified classes from Imagenet, and a little more French
Jupyter Notebook
871
star
13

course20

Deep Learning for Coders, 2020, the website
Jupyter Notebook
841
star
14

fastai2

Temporary home for fastai v2 while it's being developed
Jupyter Notebook
639
star
15

fastai_dev

fast.ai early development experiments
Jupyter Notebook
634
star
16

diffusion-nbs

Getting started with diffusion
Jupyter Notebook
546
star
17

ghapi

A delightful and complete interface to GitHub's amazing API
Jupyter Notebook
500
star
18

swiftai

Swift for TensorFlow's high-level API, modeled after fastai
Jupyter Notebook
457
star
19

course-v4

Please use fastbook's /clean folder instead of this
448
star
20

course22p2

course.fast.ai 2022 part 2
Jupyter Notebook
425
star
21

imagenet-fast

Python
301
star
22

nbdev_template

Template for nbdev projects
Python
286
star
23

numerical-linear-algebra-v2

Jupyter Notebooks for Computational Linear Algebra course, taught summer 2018 in USF MSDS program
Jupyter Notebook
266
star
24

timmdocs

Documentation for Ross Wightman's timm image model library
Jupyter Notebook
253
star
25

fast_template

A template for really easy blogging with GitHub Pages
HTML
240
star
26

fastdoc

Create publication-quality books from Jupyter notebooks
Jupyter Notebook
224
star
27

fastdiffusion

Notes and plans for fastdiffusion course
Jupyter Notebook
197
star
28

fastsetup

Setup all the things
Shell
192
star
29

fastai_old

OLD REPO - PLEASE USE fastai/fastai
Jupyter Notebook
177
star
30

book_nbs

Notebooks for upcoming fastai book (draft / incomplete)
Jupyter Notebook
166
star
31

docker-containers

Docker images for fastai
Shell
165
star
32

fastscript

A fast way to turn your python function into a script
CSS
163
star
33

word-embeddings-workshop

This contains materials for the word embeddings workshop
HTML
124
star
34

fastec2

AWS EC2 computer management for regular folks
Python
120
star
35

execnb

Execute a jupyter notebook, fast, without needing jupyter
Jupyter Notebook
102
star
36

fastai1

v1 of the fastai library. v2 is the current version. v1 is still supported for bug fixes, but will not receive new features.
Jupyter Notebook
90
star
37

tf-fit

Fit your tensorflow model using fastai and PyTorch
Python
89
star
38

fastgpu

A queue service for quickly developing scripts that use all your GPUs efficiently
Jupyter Notebook
81
star
39

fastsql

A bit of extra usability for sqlalchemy.
Python
71
star
40

book.fast.ai

Information for readers of the fastai book
Jupyter Notebook
67
star
41

nbdev-template

Python
66
star
42

fastdot

A simple wrapper over `pydot` and `graphviz` which fixes some sharp edges
Jupyter Notebook
63
star
43

nbprocess-old

Process and export Jupyter Notebooks fast (Jupyter not required)
Jupyter Notebook
52
star
44

fastkaggle

Kaggling for fast kagglers!
Jupyter Notebook
50
star
45

fastai3

Research repo for code that may or may not end up in fastai3
Jupyter Notebook
50
star
46

randomized-SVD

demos for PyBay talk: Using Randomness to make code faster
Jupyter Notebook
49
star
47

pypi_template

A minimal template for creating a pypi package
Python
49
star
48

fastdownload

Easily download, verify, and extract archives
Jupyter Notebook
44
star
49

fastforest

A forest that is fast
C++
41
star
50

fastbook2e

The fastai book, 2nd edition (in progress)
Jupyter Notebook
41
star
51

dotfiles

Vim Script
40
star
52

bear_voila

Demo bear classifier with fastai and Voila
Jupyter Notebook
40
star
53

nbdev-vscode

TypeScript
40
star
54

tinykernel

A minimal Python kernel so you can run Python in your Python
Python
39
star
55

wireguard-fast

Simplified installation of WireGuard server for Ubuntu
Shell
36
star
56

workflows

Composite Actions workflows for use in fastai projects
Python
35
star
57

tinypets

Minimal JS interface to an image classifer
HTML
35
star
58

fastai-nbstripout

much faster nbstripout and autotrust notebooks local git configuration
Python
33
star
59

fastai-docs

Documentation for fastai
HTML
32
star
60

minai

A miniture AI training framework for PyTorch
Jupyter Notebook
31
star
61

course22-web

Website for Practical Deep Learning for Coders 2022
Jupyter Notebook
30
star
62

pagegraph

Draw, modify, and execute graphs using a simple python dict interface
Jupyter Notebook
29
star
63

masks4all

Make your own mask. My mask protects you. Your mask protects me.
Jupyter Notebook
26
star
64

apl-study

fast.ai APL study group notes
Jupyter Notebook
23
star
65

fastconda

Get packages onto your conda channel faster
Jupyter Notebook
23
star
66

git-tools

Tools to make git easier to use and to avoid the learning curve
Python
19
star
67

tweetrel

Use GitHub Actions to send a tweet when you make a new release
Jupyter Notebook
18
star
68

fastrelease

DEPRECATED--all functionality moved to nbdev
Jupyter Notebook
15
star
69

fastpy

An easy way to start a python programming environment using GitHub Codespaces.
15
star
70

paperspace-setup

Setup a paperspace instance for fastai
Shell
14
star
71

jupytercon-2023

Materials for "Write, Document, Test and Distribute Python Packages With Jupyter & Quarto", JupyterCon 2023.
Jupyter Notebook
14
star
72

ethics.fast.ai

The fast.ai data ethics course
Jupyter Notebook
13
star
73

fastcups

HTML
13
star
74

fastcgi

A fastcgi handler for Python's `socketserver` classes
Jupyter Notebook
13
star
75

fastlinkcheck

Check local static links and online links fast and in parallel
Jupyter Notebook
13
star
76

dlcert2

Web site source for Practical Deep Learning for Coders (2018)
Jupyter Notebook
12
star
77

Str8Pix

find the optimal rotation to correct skewed photos
Jupyter Notebook
11
star
78

dlcert1

Deep learning certificate part 1
10
star
79

nbdev-index

nbdev docs lookup for a few libraries and python itself
Python
10
star
80

cards_deck

A minimal example of nbdev based on Allen Downey's Think Python 2nd Ed
Jupyter Notebook
10
star
81

docments

Document parameters using comments
9
star
82

nbdev2

Temporary repo for nbdev2
Jupyter Notebook
7
star
83

spacy_conda

conda packages for spacy and deps
7
star
84

hugo-mathjax

Hugo with goldmark-mathjax
Jupyter Notebook
6
star
85

wandbfastai

Jupyter Notebook
5
star
86

fastwebhook

A simple GitHub webhook server
Jupyter Notebook
5
star
87

nbeverything

5
star
88

nbdev-jekyll-theme

CSS
4
star
89

nbdev_cards

A sample of how to create a deck of cards lib using nbdev
Jupyter Notebook
4
star
90

nbdev-demo

4
star
91

nbdev-spaces-demo

A demo of how to create a Hugging Face Space with gradio within a nbdev project.
Jupyter Notebook
4
star
92

fastdispatch

Wrapper for plum dispatch to make it more compatible with fastcore's typedispatch
Jupyter Notebook
3
star
93

tanishq_blog

CSS
3
star
94

ghtop-demo

A CLI tool for showing GitHub events, written with Rich
Jupyter Notebook
3
star
95

docs

3
star
96

wandb-nbdev

Demo of Weights & Biases documentation using nbdev
2
star
97

nbdev-hello-world

Hello world from nbdev
Python
2
star
98

logos

Logos for fastai for use in websites, icons, etc.
2
star
99

jb-nbdev

Exploring how nbdev may integrate with JupyterBook
Jupyter Notebook
2
star
100

getcaddy

Simple approach to getting the Caddy web server
Shell
2
star