Skip to main content

AZDocGen: Azure Pipelines Documentation Generator 📜🚀

Python cicd workflow PyPI version License: MIT

AZDocGen is a Python-based tool to automatically generate detailed documentation for Azure Pipelines YAML files. It extracts key details, such as triggers, variables, resources, stages, jobs, steps, and conditions, and outputs structured Markdown documentation, including Mermaid diagrams for a visual summary of the pipeline.

Installation

You can install AZDocGen via pip or poetry.

Using pip

pip install azdocgen

Using Poetry

poetry add azdocgen

Usage

CLI Usage

You can use AZDocGen directly from the command line to generate documentation for an Azure Pipelines YAML file.

azdocgen <pipeline_yaml_path> <output_md_path>

Example

azdocgen azure-pipelines.yml docs/azure-pipelines-docs.md

This will parse the azure-pipelines.yml file and generate the documentation in the docs/azure-pipelines-docs.md file.

Programmatic Usage

You can also use AZDocGen as a Python library to generate documentation programmatically.

Example

import yaml
from azdocgen.generate_doc import generate_markdown
from azdocgen.triggers import parse_triggers
from azdocgen.variables import parse_variables
from azdocgen.resources import parse_resources
from azdocgen.stages import parse_stages

# Load the Azure Pipelines YAML file
pipeline_file = "azure-pipelines.yml"
output_file = "docs/azure-pipelines-docs.md"

with open(pipeline_file, "r") as f:
    yaml_content = yaml.safe_load(f)

# Parse the sections
triggers = parse_triggers(yaml_content)
variables = parse_variables(yaml_content)
resources = parse_resources(yaml_content)
stages = parse_stages(yaml_content)

# Generate Markdown documentation
generate_markdown(
    triggers=triggers,
    variables=variables,
    stages=stages,
    resources=resources,
    output_file=output_file,
    pipeline_file=pipeline_file,
)

print(f"Documentation written to {output_file}")

User Guide

Please see User Guide.

Features

  • Triggers: Extracts branch and tag triggers.
  • Variables: Documents variables defined in the pipeline.
  • Resources: Lists repositories, containers, and pipeline dependencies.
  • Stages, Jobs, and Steps: Provides a hierarchical breakdown of the pipeline.
  • Conditions: Includes all conditions at stage, job, and step levels.
  • Mermaid Diagrams: Generates visual workflows.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork this repository.
  2. Create a feature branch: git checkout -b feature/my-feature.
  3. Commit your changes: git commit -m 'Add my feature'.
  4. Push to the branch: git push origin feature/my-feature.
  5. Submit a pull request.

License

AZDocGen is licensed under the MIT License. See LICENSE for more details.

Release files for azdocgen 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for azdocgen 0.1.10
File Size Uploaded
azdocgen-0.1.10.tar.gz 9.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for azdocgen 0.1.10
File Interpreter ABI Platform
azdocgen-0.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 23.1 kB

Release files / azdocgen-0.1.10.tar.gz

Download URL azdocgen-0.1.10.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
705a171befcc029de9984ec3179335c7bc4da572c17c580b9b3128b21f58e401
BLAKE2b-256 checksum
How to use checksums
9be03640d2985bab8e7be90cf3ab0353eec79444a5054f0be7ded1c1c4c2c021
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release files / azdocgen-0.1.10-py3-none-any.whl

Download URL azdocgen-0.1.10-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9d1aad12cbfe54a7e6aca2ee6e84de88b47e243429d156ee42983e0231f5ad2
BLAKE2b-256 checksum
How to use checksums
1a20b03401c0086c89ff8b8380fb8ea2459f2b0390e31f2841f805b3aceef207
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page