nbdev is a fantastic workflow aimed at centralizing documentation, testing, and source code generation all out of one place: Jupyter Notebooks. However, what if you already have an existing project? As it stands the only way to convert your library over is through manual tasks (which can take > 30 hrs!).
lib2nbdev is the solution!
Instead, we can perform a one-time conversion on any existing library. During the conversion process the library will help you generate a proper
settings.ini configuration file for your project. However you can also generate your own
settings.ini and put it in your project's core directory, such as:
pip install lib2nbdev
From your project directory (in bash), simply run:
And it will automatically generate the notebooks needed, as well as privatizing any functions that may need it (anything preceding with a
_ in the name) where they shouldn't show in the generated documentation.
Afterwards you have a fully-functional
nbdev library, and can make use of all its goodies!
If you wish to use this library you should either:
- Use Windows Subsystem for Linux (WSL2)
- Use the Python3 interpreter in Windows:
from lib2nbdev.convert import convert_lib; convert_lib()