Metadata-Version: 2.1
Name: nbdocgen
Version: 0.1.0
Summary: nbdocgen is a command line tool to generate documentation for each and every cell in a Jupyter notebook using OpenAI Chat Completion APIs.
License: MIT
Author: Santi Adavani
Author-email: santis@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: black (>=23.7.0,<24.0.0)
Requires-Dist: click (>=8.1.6,<9.0.0)
Requires-Dist: openai (>=0.27.8,<0.28.0)
Requires-Dist: rich (>=13.4.2,<14.0.0)
Description-Content-Type: text/markdown

**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](https://python-poetry.org/)
- 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](https://platform.openai.com/docs/api-reference/authentication)

`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"
```

