Skip to main content

Parser library for project Change Log documents.

Project description

changelog-chug is a parser for project Change Log documents.

changelog-chug

Example

Given a reStructuredText document ChangeLog:

Change Log
##########

Version 1.0.1
=============

:Released: 2020-01-10
:Maintainer: Cathy Morris <cathy.morris@example.com>

…

Version 1.0
===========

:Released: 2020-01-10
:Maintainer: Luis Flores <ayalaian@example.org>

…

Version 0.2
===========

:Released: 2019-07-04
:Maintainer: Cathy Morris <cathy.morris@example.com>

…

Version 0.2-alpha1
==================

:Released: 2019-07-04
:Maintainer: Cathy Morris <cathy.morris@example.com>

…

Version 0.1
===========

:Released: 2019-05-16
:Maintainer: Cathy Morris <cathy.morris@example.com>

…

Generate Change Log entry data for all versions from the reStructuredText formatted ChangeLog:

>>> import pathlib
>>> import pprint
>>> import chug.parsers.rest
>>> import chug.writers
>>> infile_path = pathlib.Path(".", "ChangeLog")
>>> document_text = chug.parsers.get_changelog_document_text(infile_path)
>>> document = chug.parsers.rest.parse_rest_document_from_text(
...     document_text)
>>> entries = chug.parsers.rest.make_change_log_entries_from_document(
...     document)
>>> pprint.pprint([entry.as_version_info_entry() for entry in entries])
[OrderedDict([('release_date', '2020-01-10'),
              ('version', '1.0.1'),
              ('maintainer', 'Cathy Morris <cathy.morris@example.com>'),
              ('body', '…')]),
 OrderedDict([('release_date', '2020-01-10'),
              ('version', '1.0'),
              ('maintainer', 'Luis Flores <ayalaian@example.org>'),
              ('body', '…')]),
 OrderedDict([('release_date', '2019-07-04'),
              ('version', '0.2'),
              ('maintainer', 'Cathy Morris <cathy.morris@example.com>'),
              ('body', '…')]),
 OrderedDict([('release_date', '2019-07-04'),
              ('version', '0.2-alpha1'),
              ('maintainer', 'Cathy Morris <cathy.morris@example.com>'),
              ('body', '…')]),
 OrderedDict([('release_date', '2019-05-16'),
              ('version', '0.1'),
              ('maintainer', 'Cathy Morris <cathy.morris@example.com>'),
              ('body', '…')])]

Generate a JSON document describing the latest version:

>>> import json
>>> latest_entry = entries[0]
>>> latest_entry_json = json.dumps(
...     latest_entry.as_version_info_entry(), indent=4)
>>> print(latest_entry_json)
{
    "release_date": "2020-01-10",
    "version": "1.0.1",
    "maintainer": "Cathy Morris <cathy.morris@example.com>",
    "body": "\u2026"
}

Copying

changelog-chug is free software. See the file COPYING for details.

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

changelog_chug-0.0.3.tar.gz (39.3 kB view details)

Uploaded Source

Built Distribution

changelog_chug-0.0.3-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file changelog_chug-0.0.3.tar.gz.

File metadata

  • Download URL: changelog_chug-0.0.3.tar.gz
  • Upload date:
  • Size: 39.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for changelog_chug-0.0.3.tar.gz
Algorithm Hash digest
SHA256 98ee1e8be75b6e9d512c35292c3c293a124541a4ec2014a6ec3cf33a3d265d2d
MD5 4ccd595cfa9e929bfa04b7e64de3663c
BLAKE2b-256 fc6df08e0f600f88c69923c692d486096ca7d2eae5d657516ec134fb45ed0ab0

See more details on using hashes here.

File details

Details for the file changelog_chug-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for changelog_chug-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e9733f861d300cf505062de0b3bf2625ef4e99e2fb171b1e218d20072587f2ba
MD5 c1bde50588b24bbd317d46ab80bbe5e9
BLAKE2b-256 f47b759bc32d67b4ceed949843bf374231287e6069e75f292d5c55ae2cc7d9d2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page