Antsibull Changelog

0.35.0 · active · verified Wed Apr 15

Antsibull Changelog is a Python tool designed to generate changelogs for Ansible-core and Ansible collections. It processes changelog fragments (YAML files) to produce structured changelog outputs. Currently at version 0.35.0, it undergoes active development with releases aligned to the broader Ansible ecosystem's needs and feature cycles.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to programmatically parse a changelog fragment and add it to a Changelog object. While `antsibull-changelog` is primarily a CLI tool, its core components can be used for custom changelog processing within Python applications. This example shows basic interaction with fragments, which are the building blocks of the changelog.

from antsibull_changelog.changelog import Changelog
from antsibull_changelog.fragment import ChangelogFragment

# Simulate a changelog fragment content (normally read from a .yaml file)
fragment_content = """
fragment:
  - type: feature
    description: Add new awesome feature.
    section: Features
    authors:
      - John Doe
"""

# Parse a fragment from a string (or use ChangelogFragment.from_file())
try:
    fragment = ChangelogFragment.from_string("my_first_feature.yaml", fragment_content)

    # Create a Changelog object and add the fragment
    changelog = Changelog()
    changelog.add_fragment(fragment)

    print(f"Successfully parsed fragment type: {fragment.type}")
    print(f"Fragment description: {fragment.description}")
    print(f"Total fragments in Changelog object: {len(changelog.fragments)}")
except Exception as e:
    print(f"Error parsing fragment: {e}")

view raw JSON →