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.2.tar.gz (38.1 kB view details)

Uploaded Source

Built Distribution

changelog_chug-0.0.2-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: changelog_chug-0.0.2.tar.gz
  • Upload date:
  • Size: 38.1 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.2.tar.gz
Algorithm Hash digest
SHA256 6e1d216842cc596b38328c6c16b4c0e2b90e4447b13ae00166d1837c1c53c6a5
MD5 b641d3d1e27f13ec1bada2a127bfe689
BLAKE2b-256 95eddb78d44500b157b7e1f7e5b96efcafed11ef8da8bd89fffcfcc4972ca1c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for changelog_chug-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cebefff0f1bafaadee567cbc2571f1a1ae5b26d4bd05e39354356f029425f637
MD5 856f49e363b3ad8d633c37b43c917e77
BLAKE2b-256 6d52ba83d13d91fa9051ef557f66e04bd42c141452c805da71514a1243e31d25

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