nbdocgen is a command line tool to generate documentation for each and every cell in a Jupyter notebook using OpenAI.
Getting Started
Prerequisites
- Python >=3.8
- Poetry
- OpenAI API Key
Installation
git clone https://github.com/santiadavani/nbdocgen
cd nbdocgen
poetry shell
poetry install
pip install .
Usage
Set OPENAI_API_KEY environment variable. If you don't have a key please check documentation here
export OPENAI_API_KEY=<OPENAI_API_KEY>
You can check all the options using --help.
(nbdocgen-py3.9) bash-3.2$ nbdocgen --help
Usage: nbdocgen [OPTIONS]
Options:
--input PATH Input Jupyter Notebook
--output PATH Output Jupyter Notebook
--temperature FLOAT Temperature for OpenAI [default: 0.7]
--top_p FLOAT Top p for OpenAI [default: 1.0]
--max_tokens INTEGER Max tokens for OpenAI completion [default: 256]
--base_prompt TEXT Base prompt for OpenAI completion [default: Please
generate a two sentence markdown documentation for the
given Python code.]
--help Show this message and exit.
Examples
Basic Usage
nbdocgen --input <input_notebook> --output <output_notebook>
Advanced Usage
In this example, we show how to use temperature and base_prompt options.
nbdocgen --input ~/Downloads/input_notebook.ipynb \
--output ./output_notebook.ipynb --temperature 0.3 \
--base_prompt "Please generate 5 sentence markdown documentation for the code below"
Metadata
Release files for nbdocgen 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nbdocgen-0.1.0.tar.gz | 3.6 kB | Without provenance | Details for nbdocgen-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nbdocgen-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nbdocgen-0.1.0-py3-none-any.whl |
Total release size: 8.1 kB
Release files / nbdocgen-0.1.0.tar.gz
| Download URL | nbdocgen-0.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ffbdf5561eaf0215173c683b9c62a93115467ce6f48dba08d9861d598b6c8ea
|
|
BLAKE2b-256 checksum How to use checksums |
4e00bbc3deb75121e3a8ab4dfb79f33c9694e4ca3e02cbf450d1d8ef91eecf05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.7.9 Darwin/19.6.0
|
Release files / nbdocgen-0.1.0-py3-none-any.whl
| Download URL | nbdocgen-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e860b98519ad22baea4a130f6a9c7f695a793d7c919c366c7994a970c88b186e
|
|
BLAKE2b-256 checksum How to use checksums |
d2140e4993807159767892e05ddae3a111ebfdff53dfc4f24289e4525609cb65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.7.9 Darwin/19.6.0
|
Security for nbdocgen 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.