Skip to main content

This package is under construction. A stable version should be release soon as 1.0.0

Project description

MDPyDoc Logo

MDPyDoc 📝🐍

MDPyDoc is a powerful and flexible Python documentation generator that automatically creates markdown documentation from your Python source code. It analyzes the Abstract Syntax Tree (AST) of your Python files to extract docstrings, function signatures, and class structures, generating comprehensive and well-formatted documentation.

Features ✨

  • 📄 Generates markdown documentation for Python modules, classes, and functions
  • 🛠️ Supports both standard logging for enhanced logging capabilities
  • 📜 Includes source code in the documentation (optional)
  • ⚡ Utilizes parallel processing for faster documentation generation of large projects
  • 🎊 Provides colored console output for better readability during the generation process
  • 🔧 Supports custom logging levels
  • 🏷️ Automatically detects and documents class inheritance
  • 📊 Generates parameter tables for functions and methods

Installation 🚀

You can install MDPyDoc using pip:

pip install mdpydoc

Usage 🖥️

You can use MDPyDoc either as a command-line tool or integrate it into your Python scripts.

Command-line Usage 💻

python -m mdpydoc /path/to/source /path/to/docs --show-code --log-level DEBUG --max-workers 4

Arguments:

• src_directory: Source directory containing Python files
• docs_directory: Target directory for generated documentation
• --show-code: Include source code in documentation (optional)
• --log-level: Set the logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
• --max-workers: Maximum number of worker threads (positive integer or 'None')

Python Script Usage 📜

from mdpydoc.doc_generator import DocGenerator

doc_generator = DocGenerator(
    show_code=True,
    log_level="INFO",
    max_workers=4
)

doc_generator.process_directory("/path/to/source", "/path/to/docs")

Components 🧩

MDPyDoc consists of several key components:

• DocGenerator: The main class that orchestrates the documentation generation process.
• MarkdownGenerator: Responsible for converting AST nodes into formatted Markdown.
• ASTParser: Parses the Abstract Syntax Tree of Python files.
• DocStringParser: Extracts and parses docstrings from AST nodes.
• FileProcessor: Processes individual Python files.
• AppLogger: A versatile logger.

Customization 🎨

MDPyDoc is designed to be extensible. You can customize the documentation generation process by subclassing and overriding methods in the MarkdownGenerator class.

Contributing 🤝

Contributions to MDPyDoc are welcome! Please feel free to submit a Pull Request.

License 📜

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments 🙏

Thanks to all contributors who have helped to improve MDPyDoc. Special thanks to the Python community for providing excellent tools and libraries that made this project possible.

TODO 📝

• Add support for generating documentation in different output formats (e.g., HTML, PDF)
• Implement a progress bar for large projects
• Add an option to exclude specific files or directories from documentation
• Implement cross-referencing between documented elements
• Add support for custom documentation templates

Support 📞

If you encounter any problems or have any questions, please open an issue on the GitHub repository.

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

mdpydoc-0.2.5.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

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

mdpydoc-0.2.5-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file mdpydoc-0.2.5.tar.gz.

File metadata

  • Download URL: mdpydoc-0.2.5.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for mdpydoc-0.2.5.tar.gz
Algorithm Hash digest
SHA256 f632c0e96c8d8c3ad9d5712e211cca6a92d93ff3b2387ba0b037e39c7bdc55e5
MD5 3fb7a214c957dc736eb6179353dadfb8
BLAKE2b-256 1319199784487b8ddc6bca3805132bb12a45143e809dbf6975ed849e61186af6

See more details on using hashes here.

File details

Details for the file mdpydoc-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: mdpydoc-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for mdpydoc-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9a58a484fd2efc4a21b351874ccbfa7efe6957f3734c81544ef53f4d5b34057d
MD5 54e0214383c530fc175d276baea7e584
BLAKE2b-256 81ff23ba9e8b6414322bb9284c00b767cd6d62ce477d7a70f5fe9e29b659ac2b

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