Skip to main content

parse-changelog

This is a simplified changelog updater/parser, made for CI pipeline use. It has these abilities:

  1. Add a new change to the changelog, in the Unreleased section
  2. Add a new release into the changelog, using the list of changes from the Unreleased section
  3. Parse the releases in the changelog into a JSON structure.

Changelogs must be in the format documented by Keep a Changelog, see the details below.

Release history: parse-changelog's CHANGELOG

Adding a Release

This mode is invoked by using the --release arg and will parse the changelog and insert a new release at the beginning of the list of releases, using the changes from the Unreleased section. You can optionally specify a release date, or by default use todays date.

The changelog must use the format ## [Unreleased] (case insensitive) for this parser to find it. For example, here is the diff generated by adding a new release(--release 1.0.2):

## [Unreleased]
+
+## [1.0.2] - 2022-10-20
 * Great new stuff

 ## [1.0.1] - 2022-10-08

Adding a Change

This mode is invoked with the --add-change and --type args. It will parse the changelog to find the Unreleased section and any changes already there, find the correct change type heading, and add the new change. For example, here is the diff generated by adding a new fix (--add-change "Fix that annoying bug" --type fixed):

## [Unreleased]
 * Great new stuff
+### Fixed
+* Fix that annoying bug

 ## [1.0.1] - 2022-10-08

Changelog Parsing

This mode will parse the changelog into JSON and print it to the screen. It finds all of the heading2 entries (lines starting with ##) and assumes each of those is a release. For each release, it parses the release title into version and date, and collects the content of the release as a single string. Each release heading must be of the format ## [release_version] - YYYY-MM-DD, where release_version matches SemVer version string spec, and YYYY-MM-DD is a valid year-month-day. The one exception to this format is the special release heading for unreleased changes, which must match ## [Unreleased]. The content of the release is parsed as a single string and not interpreted in any way.

The top heading1 and project description are parsed into a special section named "introduction".

For example, given the following changelog:

# Changelog

My Project Name

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
* Great new stuff

## [1.0.1] - 2022-10-08
### Fixed
* Minor bug that we missed
### Changed
* New name for an artifact

## [1.0.0] - 2022-09-01
Initial release
* Some cool feature
* Other interesting stuff

It will be parsed into this JSON:

{
  "introduction": {
    "title": "Changelog",
    "content": "\nMy Project Name\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).",
    "version": "",
    "date": ""
  },
  "prerelease": {
    "title": "[Unreleased]",
    "content": "* Great new stuff",
    "version": "prerelease",
    "date": "unreleased"
  },
  "[1.0.1] - 2022-10-08": {
    "title": "[1.0.1] - 2022-10-08",
    "content": "### Fixed\n* Minor bug that we missed\n### Changed\n* New name for an artifact",
    "version": "1.0.1",
    "date": "2022-10-08"
  },
  "[1.0.0] - 2022-09-01": {
    "title": "[1.0.0] - 2022-09-01",
    "content": "Initial release\n* Some cool feature\n* Other interesting stuff",
    "version": "1.0.0",
    "date": "2022-09-01"
  }
}

Metadata

Release files for parse-changelog 1.0.11

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

Source distribution (sdist)

Source distribution for parse-changelog 1.0.11
File Size Uploaded Provenance Actions
parse_changelog-1.0.11.tar.gz 7.8 kB Without provenance Details for parse_changelog-1.0.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for parse-changelog 1.0.11
File Interpreter ABI Platform Actions
parse_changelog-1.0.11-py3-none-any.whl Python 3 none any Details for parse_changelog-1.0.11-py3-none-any.whl

Total release size: 14.9 kB

Release files / parse_changelog-1.0.11.tar.gz

Download URL parse_changelog-1.0.11.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0aecdb0ca8f3d0cc6c248976acf03fcdba963972892201af6de05ecdea51d097
BLAKE2b-256 checksum
How to use checksums
548d47a6396fdd8d1677548d611cf22d6061b535a5e874d7ab60f18da7164eda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.13

Release files / parse_changelog-1.0.11-py3-none-any.whl

Download URL parse_changelog-1.0.11-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
618e9b0d5ae04181b371550c093a8f16e4efbc33910683ebdae03b6f46fa67ac
BLAKE2b-256 checksum
How to use checksums
208b69ca69526e198634ee0b71447ea8636e4d813e31213f1da49c71cee12888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.0 CPython/3.12.13

Security for parse-changelog 1.0.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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