This repository contains a web application that helps developers document Python code with the assistance of AI.
The project has been organized into a more maintainable structure:
frontend/: Contains the Next.js frontend applicationbackend/: Contains the Python backend applicationdocker/: Docker configuration filesscripts/: Utility scriptsdocs/: Project documentation
For more details on the project structure, please see docs/README.md.
Prerequisites
Before running the application, you need to set up your environment variables:
- Copy the
.env.local.examplefile to.env:cp .env.local.example .env
- Open the
.envfile and fill in the required values (API keys, database connection, etc.)
1. Frontend
cd frontend
npm install
npm run dev2. Backend
cd backend
pip install -r requirements.txt
python -m pydocass3. Docker
docker-compose up -dContributions are welcome! Please feel free to submit a Pull Request.
A command-line interface for the Python Documentation Assistant (PyDocAss), which automatically adds type annotations, docstrings, and comments to your Python code.
- Python 3.7+
- OpenAI API key or Nebius AI Studio API key
Make sure you have the required packages installed:
pip install pydocass openai black./cli_document.py [options] input_fileOr:
python cli_document.py [options] input_fileinput_file: Path to the Python file to document. Use-to read from stdin.
-o, --output: Path to write the documented code. If not provided, will print to stdout.--no-modify-existing: Don't modify existing documentation.--no-arguments-annotations: Don't write argument annotations.--no-docstrings: Don't write docstrings.--no-comments: Don't write comments.--model: Model checkpoint to use. Default: Qwen/Qwen2.5-Coder-32B-Instruct-fast--api-key: API key for Nebius AI Studio or OpenAI. Can also be set via NEBIUS_API_KEY or OPENAI_API_KEY environment variables.--verbose: Show progress updates during documentation process.
Document a Python file and print the result to stdout:
./cli_document.py example.pyDocument a Python file and save the result to a new file:
./cli_document.py example.py -o documented_example.pyDocument a Python file with specific options:
./cli_document.py --no-comments --no-docstrings example.py -o annotations_only.pyRead from stdin and write to a file:
cat example.py | ./cli_document.py - -o documented_example.pyYou can set your API key using environment variables:
export NEBIUS_API_KEY=your_api_key
# or
export OPENAI_API_KEY=your_api_keyThen run the script without specifying the API key:
./cli_document.py example.py