Nbdev, developed out of fast.ai, is a literate programming environment that enhances and streamlines the software engineering process through the power of Jupyter Notebooks, a sandbox programming environment for Python. Code, documentation, and tests are all centralized in one location, providing a natural “flow” to ease the development-to-production pipeline. As a result, nbdev makes it easier to transform rapid prototyping projects into high-quality software packages without sacrificing readability and testing.
The full nbdev suite includes:
- Python exported modules from a notebook, which simplifies version control
- Auto-generated, searchable, hyperlinked documentation
- Easy project release generators through fastrelease
- Multiprocessing functionality for running tests
- Continuous integration testing with GitHub Actions
Converting existing projects to nbdev
Novetta released an open source project, lib2nbdev, which performs a one-time conversion of existing Python projects into nbdev libraries. This project minimizes the time it takes to set up a new nbdev repository, migrate all the code to notebooks, and write documentation, a process that can take teams over 30 hours.
Through a simple command-line interface, lib2nbdev builds projects and automatically generates notebooks with the proper headings and format that nbdev expects. Developers can then immediately work towards writing more documentation, including tests, or continue to develop their project as though nbdev were used from the very beginning.
At Novetta, we used lib2nbdev to completely migrate our open source NLP library, AdaptNLP, to the nbdev workflow. This improved our testing coverage by over 50%.
We are open-sourcing lib2nbdev to drive further adoption of the nbdev platform and normalize exploratory programming in the data science and software engineering communities.
To learn more about nbdev, check out the tutorials.