Skip to main content

Simple Python documentation generator - parse code, generate markdown

Project description

PyDocGen 🐍

CI License: MIT

Automatically generate simple markdown documentation from Python codebases.

What It Does

PyDocGen parses Python files and generates clean markdown documentation showing:

  • Classes with their methods and docstrings
  • Functions with arguments and docstrings
  • Simple, readable API documentation

Installation

From PyPI (Recommended)

pip install simplepydoc

From Source (Development)

# Clone the repository
git clone https://github.com/msodiq19/llm-docgen.git
cd llm-docgen

# Install with Poetry
poetry install

Usage

# If installed from PyPI
simplepydoc generate --repo ./src/myproject --output ./docs

# If running from source with Poetry
poetry run simplepydoc generate --repo ./src/myproject --output ./docs

# Example: Generate docs for PyDocGen itself
simplepydoc generate --repo ./src/llm_docgen --output ./docs

This creates docs/API.md with documentation extracted from your Python code.

Example Output

Given this Python code:

class Calculator:
    """A simple calculator."""

    def add(self, a, b):
        """Add two numbers."""
        return a + b

def helper():
    """A helper function."""
    pass

PyDocGen generates:

# myproject API Documentation

## Classes

### Class: `Calculator`

A simple calculator.

**Methods:**

- **`add`**: Add two numbers.

## Functions

### `helper()`

A helper function.

Current Scope (MVP)

  • ✅ Python files only
  • ✅ Parses classes, methods, and functions
  • ✅ Extracts docstrings
  • ✅ Generates markdown output
  • ❌ No template customization (simple, opinionated format)
  • ❌ No notebook support
  • ❌ No remote repository cloning (use local paths)

Development

# Run tests
poetry run pytest

# Run with coverage
poetry run pytest --cov=src

# Run the CLI during development
poetry run simplepydoc generate --repo ./src/llm_docgen --output ./docs

# Format code
poetry run black src tests

# Lint
poetry run flake8 src tests

Contributing

See CONTRIBUTING.md for development guidelines.

License

MIT - see LICENSE for details.

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

simplepydoc-0.1.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simplepydoc-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file simplepydoc-0.1.1.tar.gz.

File metadata

  • Download URL: simplepydoc-0.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/5.15.0-118-generic

File hashes

Hashes for simplepydoc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ef2e068b6c58cf111f1c989b55dc082dcf4b2fee647bafb99c73dee5c13f2cee
MD5 0d8f717f17d269f4afb8bfab291c3510
BLAKE2b-256 ddabd425f37226fb63dfddb5923589b80a38599ae82df4fff673eaaf1b5458c4

See more details on using hashes here.

File details

Details for the file simplepydoc-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: simplepydoc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.12 Linux/5.15.0-118-generic

File hashes

Hashes for simplepydoc-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 14fc30ec79248820603fa390ae5ba73e96a026bfaa42b0dd436b383fee9912b2
MD5 3404e96935b8254afd955760871316b2
BLAKE2b-256 6c64dff8d9413701486e2b9eaa6b8eef5b7bf0e0189d34aeba489410bf8262e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page