Observed since 21 Oct, 10:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
ai-doc-generator
AI-powered documentation generator for Python projects using OpenAI
Automatically generate comprehensive documentation for your Python projects using OpenAI's GPT models. This tool analyzes your codebase and creates detailed, well-structured documentation that helps developers understand and use your code effectively.
pip install ai-doc-generator
Or install from source:
git clone https://github.com/haseebrj17/ai-doc-generator.git
cd ai-doc-generator
pip install -e .
export OPENAI_API_KEY="your-api-key-here"
ai-doc-gen /path/to/your/project
That's it! Your documentation will be generated in docs/generated/.
# Generate docs for current directory
ai-doc-gen
# Generate docs for specific path
ai-doc-gen /path/to/project
# Force full regeneration (ignore cache)
ai-doc-gen --full
# Use a specific model
ai-doc-gen --model gpt-4o-mini
# Custom output directory
ai-doc-gen --output docs/api
# Include test files
ai-doc-gen --include-tests
# Dry run to see what would be documented
ai-doc-gen --dry-run
from ai_doc_generator import Config, DocumentationGenerator
# Create configuration
config = Config(
project_root="./my_project",
output_dir="./docs",
include_tests=False,
model="gpt-4o"
)
# Generate documentation
generator = DocumentationGenerator(config)
generator.generate_documentation()
Create a ai-doc-config.json file in your project root:
{
"model": "gpt-4o",
"output_dir": "docs/generated",
"include_patterns": ["*.py"],
"exclude_dirs": ["tests", "__pycache__", ".venv"],
"exclude_files": ["setup.py"],
"max_file_size": 100000,
"include_tests": false
}
For a typical Python project:
After initial generation, incremental updates cost 90% less!
docs/generated/
├── README.md # Main documentation index
├── project-overview.md # High-level project analysis
├── api-reference.md # Complete API reference
├── modules/ # Module-specific documentation
│ ├── core/
│ ├── utils/
│ └── ...
└── documentation.json # Raw documentation data
Only regenerate documentation for files that have changed:
# First run - documents everything
ai-doc-gen
# Subsequent runs - only changed files
ai-doc-gen
Customize the documentation style:
config = Config(
system_prompt="Generate concise API documentation focusing on usage examples..."
)
Use different models for different purposes:
gpt-4o: Best quality, detailed documentationgpt-4o-mini: Faster and cheaper, good for most projectsgpt-4-turbo-preview: Balance of quality and cost# Clone the repository
git clone https://github.com/haseebrj17/ai-doc-generator.git
cd ai-doc-generator
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run linting
black .
flake8 .
mypy .
# Run tests with coverage
pytest --cov=ai_doc_generator
The project documentation is available at: https://haseebrj17.github.io/ai-doc-generator/
gh-pages branch and / (root) folderThis project has automated publishing workflows:
When you push changes to main with an updated version in pyproject.toml, the package will automatically be published to PyPI if all tests pass.
git tag v1.0.1 && git push origin v1.0.1PYPI_API_TOKEN in your repository secrets (Settings → Secrets → Actions)TEST_PYPI_API_TOKEN for test releasesContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by Muhammad Haseeb
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
openaiEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | openai>=1.0.0 | runtime |
tqdmEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | tqdm>=4.65.0 | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | pytest>=7.0.0; extra == "dev" | runtime |
pytest-covEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | pytest-cov>=4.0.0; extra == "dev" | runtime |
pytest-mockEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | pytest-mock>=3.10.0; extra == "dev" | runtime |
blackEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | black>=22.0.0; extra == "dev" | runtime |
flake8Environment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | flake8>=6.0.0; extra == "dev" | runtime |
mypyEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | mypy>=1.0.0; extra == "dev" | runtime |
pre-commitEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | pre-commit>=3.0.0; extra == "dev" | runtime |
sphinxEnvironment{
"extras": "",
"marker": "extra == \"docs\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | sphinx>=5.0.0; extra == "docs" | runtime |
sphinx-rtd-themeEnvironment{
"extras": "",
"marker": "extra == \"docs\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | sphinx-rtd-theme>=1.0.0; extra == "docs" | runtime |
myst-parserEnvironment{
"extras": "",
"marker": "extra == \"docs\"",
"requires_python": ">=3.8",
"evaluation": "NOT_EVALUATED"
} | myst-parser>=0.18.0; extra == "docs" | runtime |
bdist_wheel · 24.12 KB · Python py3
sdist · 41.58 KB · Python source
Shared repository data · GitHub
Observed since 21 Oct, 10:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:72b09d199dd0520f0c46c48359bd0b8ea46d7d712834ed4597aa016ee1e3bd78