Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

changelog-chug

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

changelog-chug

Parser library for project Change Log documents.

  • 0.0.3
  • PyPI
  • Socket score

Maintainers
1

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.

.. _COPYING: COPYING

.. This document is written using reStructuredText_ markup, and can be rendered with Docutils_ to other formats.

..  _Docutils: http://docutils.sourceforge.net/
..  _reStructuredText: http://docutils.sourceforge.net/rst.html

.. Local variables: coding: utf-8 mode: rst End: vim: fileencoding=utf-8 filetype=rst :

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc