AI-powered Python documentation enhancer supporting local LLMs (LLaMA, Ollama) and cloud providers.
Project description
PyDocEnhancer
AI-powered Python plugin to enhance documentation with summaries, code explanations, examples, semantic search, automated example testing, and multilingual documentation.
Features
- Auto-Generated Summaries: Summarize modules, classes, and functions.
- Code Explanations: Plain-English explanations of code logic.
- Semantic Search: Query documentation with natural language (e.g., "find data processing functions").
- Auto-Generated Examples: Create working code examples from docstrings.
- Automated Example Testing: Extracts and runs code examples from docstrings, reporting results in the docs.
- Multilingual Documentation: Generate documentation in multiple languages (e.g., English, French, Spanish, Chinese) using LLM translation.
- Local LLM Support: Privacy-first processing with local models (e.g., LLaMA 3.2, Ollama).
- Integrations: Works with Sphinx, MkDocs, and Jupyter Notebooks.
Installation
pip install pydocenhancer
Quick Start
from pydocenhancer import DocEnhancer
# Initialize with a local LLM (Ollama or LLaMA), generate docs in French
enhancer = DocEnhancer(provider="local", model="ollama/llama3", language="fr")
enhancer.generate_docs(module_path="my_project/utils.py", output_dir="docs", language="fr")
# Search documentation
results = enhancer.search_docs("file handling functions", "docs")
print(results)
CLI Usage
# Generate documentation with Ollama in Spanish, with example testing
pydocenhancer enhance --module my_project/utils.py --output docs/ --provider local --model ollama/llama3 --language es
# Search documentation
pydocenhancer search --query "data processing functions" --docs-dir docs/
Requirements
- Python 3.8+
- Local LLM (e.g., LLaMA 3.2 via
llama-cpp-pythonor Ollama) - Optional: Sphinx or MkDocs for integration
Documentation
Full documentation is available in this README and at GitHub.
License
MIT © Abdoullah Ndao abdoullahaljersi@gmail.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pydocenhancer-1.0.0.tar.gz.
File metadata
- Download URL: pydocenhancer-1.0.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de7ee0a1d36c5bd2156393914db7ee9599864e599e805582a59e3361ab096376
|
|
| MD5 |
6b6a9ba46cf4245346154f25af23c50f
|
|
| BLAKE2b-256 |
7df01ed50336506c227f2e0eaf84dab55a73c39ca726fcc41cdfa527efcd9b27
|
File details
Details for the file pydocenhancer-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pydocenhancer-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18038f6a06256ed38566dfbbc41da9109ecbf8e2633ad7de50012b14d4303bd7
|
|
| MD5 |
483f1201e62727952e317528261ca3a0
|
|
| BLAKE2b-256 |
712973c853036ec7aeba3642da4ac9e2de6e51e02920848eb2b07d63bb4754de
|