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.0.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.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simplepydoc-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 a8ab6c08efe78f91b5dc5f12ea5ede56d4de6cdfd7795b23f0d82bcb7e427664
MD5 3cd83e8382344d4a01645b0d1c1e6004
BLAKE2b-256 b9982ca0ea6e03580d23f72e519ac081636f7613268a43a6c85648a787cb9d96

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simplepydoc-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b77b1576eaf0cd201bdcc35b79bcfc70531bfd7525b7ea39888140bdb2836e7
MD5 116b16f2be2afd542548880a51bbcaa2
BLAKE2b-256 19ee0ee42e14513b74e9f0712926b12c251081f27b89f9a4a616d0dc7d1f5313

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