Overview
When creating Python packages, I use nbdev.
nbdev is described as follows:
Write, test, document, and distribute software packages and technical articles — all in one place, your notebook.
This article serves as a memo when using nbdev.
Installation
The following tutorial page is a helpful reference.
https://nbdev.fast.ai/tutorials/tutorial.html
Below is a brief overview of the workflow.
After installing the related tools, create a GitHub repository, clone it, and then execute the following in the cloned directory.
After that, also run the following.
Then edit files like 00_core.ipynb in the nbs folder, and execute the following in the last cell of the notebook.
As a result, Python modules are automatically created.
Installing the Package
Within the Same Folder
Execute the following.
From a Different Folder
As one example, install by specifying the absolute path.
Example: For /Users/hogehoge/tei_xml_tools
By using the -e option, changes made to the package during development can be used immediately.
Using the Library
By using % as shown below, changes made during development could be reflected.
Summary
Additionally, commands are provided for previewing documentation and uploading to PyPI. If the opportunity arises, I would like to write an article about using nbdev in general.