pychangelog module

The toplevel module for the pychangelog package.

class pychangelog.ChangeLog(*releases)[source]

Bases: _abcoll.Sequence

A ChangeLog object is simply a sequence of ReleaseInfo objects, in order form oldest to newest. There are rules used to validate the change log, for instance that each release must be numerically next after the previous, version numbers must increase correctly, full-releases cannot follow pre-releases, and dates must increase correctly.

Pass in the ReleaseInfo objects from oldest to newest.

__init__(*releases)[source]

Pass in the ReleaseInfo objects from oldest to newest.

last_release()[source]

Returns the index in the sequence of the last full release (i.e., not a pre_release).

Returns None if no full releases are mentioned in the change log.

See also

get_last_release to get the actul corresponding ReleaseInfo object.

get_last_release()[source]

Returns the ReleaseIngo object for the last full release in the log (i.e., not a pre_release).

Returns None if no full releases are mentioned in the change log.

See also

last_release to get just the index of the last release.

__len__()[source]

Returns the number of releases in the change log.

__getitem__(idx)[source]

Get the ReleaseInfo object at the specified index, where 0 is the oldest.

append(release)[source]

Add a new ReleaseInfo object to the end (top) of the change log. This should be a release after the most recent.

__abstractmethods__ = frozenset([])
__module__ = 'pychangelog'
class pychangelog.ReleaseInfo(release_num, version_numbers, year, month, day, pre_release=False, *change_lines)[source]

Bases: _abcoll.Sequence

Encapsulates information about a single release, usually a member of a ChangeLog.

A ReleaseInfo object acts as a Sequence over the change-lines it mentions in the change log (i.e., the entries that describe the changes in the release from the previous.

Each such line must have a type: usually one of TYPE_MAJOR, TYPE_MINOR, TYPE_PATCH, or TYPE_SEMANTIC, specfiying the scope of the impact on the public interface. However, for the first release (release #1), each line should instead be simple a TYPE_STAR line, since there is no public interface prior to the first release.

In addition to iterating over all the lines in the release, you can get a View ojbect which acts as a Sequence over just a particular type of line. One such View is created during initialization for each of the five types of lines, and you can get a handle to these View objects using the major, minor, patch, semantic, and starred properties.

TYPE_STAR = 0
TYPE_MAJOR = 1
TYPE_MINOR = 2
TYPE_PATCH = 3
TYPE_SEMANTIC = 4
__init__(release_num, version_numbers, year, month, day, pre_release=False, *change_lines)[source]
__str__()[source]
__repr__()[source]
class View(obj, length, getitem)[source]

Bases: _abcoll.Sequence

__init__(obj, length, getitem)[source]
__len__()[source]
__getitem__(idx)[source]
__abstractmethods__ = frozenset([])
__module__ = 'pychangelog'
ReleaseInfo.major[source]
ReleaseInfo.minor[source]
ReleaseInfo.patch[source]
ReleaseInfo.semantic[source]
ReleaseInfo.starred[source]
ReleaseInfo.major_count()[source]
ReleaseInfo.get_major(idx)[source]
ReleaseInfo.minor_count()[source]
ReleaseInfo.get_minor(idx)[source]
ReleaseInfo.patch_count()[source]
ReleaseInfo.get_patch(idx)[source]
ReleaseInfo.semantic_count()[source]
ReleaseInfo.get_semantic(idx)[source]
ReleaseInfo.starred_count()[source]
ReleaseInfo.get_starred(idx)[source]
ReleaseInfo.pre_release[source]
ReleaseInfo.version[source]
ReleaseInfo.year[source]
ReleaseInfo.month[source]
ReleaseInfo.day[source]
ReleaseInfo.date[source]
ReleaseInfo.release_num[source]
ReleaseInfo.__len__()[source]
ReleaseInfo.__getitem__(idx)[source]
ReleaseInfo.iter()[source]
ReleaseInfo.append(line)[source]
ReleaseInfo.__abstractmethods__ = frozenset([])
ReleaseInfo.__module__ = 'pychangelog'
classmethod ReleaseInfo.parse_line(line)[source]
pychangelog.parse_plain_text(istream)[source]

Parses a change log in plain-text format, with newst release at the beginning, and returns a ChangeLog object.