Skip to main content

changelog-parser

Yet another python changelog parser.

  • Loads data from a CHANGELOG.md file using code like:
    import changelog
    
    with open( "CHANGELOG.md", 'rb' ) as fp:
      changes = changelog.load( fp )
    
    or
    import changelog
    
    with open( "CHANGELOG.md", 'r' ) as fp:
      changes = changelog.loads( fp.read() )
    
  • Returns it in the following schema (some types are Python objects and not valid JSON schema):
    {
      "$schema": "https://json-schema.org/draft-07/schema#",
      "title": "Loaded Changelog",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "version": {
            "oneOf": [ {
              "const": "Unreleased"
            }, {
              "type": "semver.Version",
              "description": "Python object from https://pypi.org/project/semver/"
            } ]
          },
          "date": {
            "oneOf": [ {
              "const": null
            }, {
              "type": "datetime.date",
              "description": "Python object from https://docs.python.org/3/library/datetime.html#date-objects; parsed using \"fromisoformat\""
            } ]
          },
          "yanked": {
            "type": "boolean"
          },
          "added": { "$ref": "#/$defs/change_list" },
          "changed": { "$ref": "#/$defs/change_list" },
          "depreciated": { "$ref": "#/$defs/change_list" },
          "removed": { "$ref": "#/$defs/change_list" },
          "fixed": { "$ref": "#/$defs/change_list" },
          "security": { "$ref": "#/$defs/change_list" },
          "compare_url": {
            "type": "string",
            "pattern": "^https?:\\/\\/.+"
          }
        },
        "required": [ "version", "date", "yanked" ],
        "additionalProperties": false
      },
      "$defs": {
        "change_list": {
          "type": "array",
          "items": { "type": "string" }
        }
      }
    }
    
  • Dumps data, structured like that above, to a CHANGELOG.md file using code like
    import changelog
    import semver
    from datetime import date
    
    with open( "CHANGELOG.md", 'rb' ) as fp:
      changes = changelog.load( fp )
    
    changes.insert( 0, {
       "version": semver.Version( major = 0, minor = 0, patch = 6 ),
       "date": date.today(),
       "added": [ "`dump` and `dumps` examples" ]
    } )
    
    with open( "CHANGELOG.md", 'wb' ) as fp:
      changelog.dump( changes, fp )
    
    or
    import changelog
    ...
    changelog_contents = changelog.dumps( changes )
    with open( "CHANGELOG.md", 'w' ) as fp:
      fp.write( changelog_contents )
    

Metadata

Release files for changelog-parser 0.0.8

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

Source distribution (sdist)

Source distribution for changelog-parser 0.0.8
File Size Uploaded
changelog-parser-0.0.8.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for changelog-parser 0.0.8
File Interpreter ABI Platform
changelog_parser-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / changelog-parser-0.0.8.tar.gz

Download URL changelog-parser-0.0.8.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6b900d4230985df4aafed8f0649dd08a67c079ce53076f9dd5ba85c1da17903a
BLAKE2b-256 checksum
How to use checksums
351ba8872f8acfe436545816859cb5ddbf3788fd4ce0030d4560c0fc8c98a7ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / changelog_parser-0.0.8-py3-none-any.whl

Download URL changelog_parser-0.0.8-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39748c96a6f20a2dcc95a9d4abda76f44a15274bb61b780c23f63fb6cbf280bf
BLAKE2b-256 checksum
How to use checksums
6833828fc6e1bad0970d90d81720c9526d6f18c3e1726b3234dbaa6a03f6efa8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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