{ "info": { "author": "Sergey Poznyakoff", "author_email": "gray@gnu.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: General" ], "description": "Release Log Parser\n==================\nSoftware packages usually include textual files describing noteworthy\nchanges in each subsequent release. There exist several variants (or\nformats) of such files.\n\nThis package provides Python framework for parsing the most often used\nformats of such release log files. Support for any new format can be\neasily added.\n\nRelease Logs\n============\n``Release Log`` is a textual file included in a software package, which\ncontains descriptions of existing releases of the package. Such a\nfile is normally included in each distributed archive of the package\nand is present in its VCS repository.\n\nLittle or no effort has been invested into standartization of release\nlog formats. There exists a plethora of variations which differ more\nor less considerably. The choice of a particular variation for a given\npackage depends mostly on the language this package is written in and\nthe distribution system adopted for this package. Authors' preferences\nplay certain role as well.\n\nDespite the diversity of release log formats, similarities between\nthem overnumber their differences. The following observations hold true:\n\n1. Release logs are plaintext files.\n2. Within a file, each release is described by a separate entry.\n3. Each such entry consists of a heading, containing at least the\n version number and date of the release, and a textual block discussing\n the changes introduced with this release.\n4. Entries are arranged in reverse chronological order, the most\n recent release being described first.\n5. Format of the headings is consistent throughout the given release\n log.\n6. Entry description is usually a list of changes. However, more\n verbose and general descriptions may also appear within it. In\n general, it is safest to assume the description to be an opaque block\n of arbitrary text.\n7. Release logs can contain additional textual information before the\n first release entry (a \"prologue\") and after the last release entry\n (an \"epilogue\").\n\nSupported Formats\n=================\nMost frequently used release log formats can be grouped into three\nmain families:\n\n``GNU-style`` release logs\n\n These are normally used by GNU software. Such log files are usually named\n \"NEWS\". Example heading lines are::\n\n version 1.30 - Sergey Poznyakoff, 2017-12-17\n Version 1.18 - 2018-08-21\n * Version 4.2, 2014-05-23\n\n``Perl-style`` release logs\n\n These are the \"Changes\" files included in each Perl package\n distributed via CPAN. Example heading lines::\n\n 2.00 2018-03-08\n 1.01 Sat Jul 7 19:11:35 2018 \n\n``Python package`` release logs\n\n The \"CHANGES.txt\" files found in many Python packages. Example heading\n lines:\n\n v2.0.1, 2014/12/14 -- Update token generator\n 2.7 (23 June 2018)\n\n The special feature of the first heading variant is that the first\n line of the changeset description follows the heading on the same\n physical line. Quite often this is the only line in the description.\n\nUsage\n=====\nThe ``ReleaseLog`` class is a fabric returning actual release history\nimplementation, depending on the first argument to its constructor.\nTypical usage::\n\n rl = ReleaseLog('GNU', content, count=1)\n\nThe two mandatory arguments are the format name and the list of lines\nobtained from the release log file.\n\nValid format names for this version of ``releaselogparser`` are:\n\n``GNU``, ``NEWS``\n GNU-style news file.\n``CPAN``, ``Changes``\n Perl-style release log.\n``Python``, ``python``\n Python-style release log.\n\nSupported keyword arguments are:\n\nstart = *N*\n Start parsing from the entry *N*. Entries are numbered from 0.\nstop = *N*\n Stop parsing on the entry *N*.\ncount = *N*\n Collect at most *N* entries\n\nIf all three keywords are given, the actual range of history entries\nis computed as\n\n [start, min(start+count, stop)]\n\nTwo derived classes are provided that read input data from various\nsources:\n\nclass ``ReleaseLogFile``\n------------------------\nThe ``ReleaseLogFile`` class reads release log from the file::\n\n rl = ReleaseLogFile(fmt, file [, kwargs...])\n\nHere, ``fmt`` is the name of the format, ``file`` is the name of the\ninput file, and ``kwargs`` are keyword arguments described above.\n\nclass ``ReleaseLogURL``\n-----------------------\nThe ``ReleaseLogURL`` class reads log entries from a URL::\n\n rl = ReleaseLogURL(fmt, url [, kwargs...])\n\nAcessing release information\n----------------------------\nThe returned object can be indexed to obtain particular log\nentries. Indices start with 0, which corresponds to the most recent\nentry, e.g.:\n\n entry = cl[0]\n\nThe ``entry`` is an object of class ``Release``, which has three\nattributes:\n\n``version``\n Release version number.\n``date``\n Date and time of the release (a datetime object)\n``descr``\n Textual description of the release - a list of lines.\n\nThe obtained entry can be printed as string, e.g.:\n\n print(entry)\n\nThe output format is as shown in the example below:\n\n Version 1.0, released at 2018-08-19 15:30:00\n\nExample\n=======\nThe following simple program reads release log entries from the file\n``NEWS`` and prints them on the standard output::\n\n from releaselogparser.input import ReleaseLogFile\n\n for log in ReleaseLogFile('GNU', 'NEWS'):\n print(log)\n print('\\n'.join(log.descr))\n\nExtending Release Log\n=====================\nImplementing support for new release log format is fairly easy. To do\nso, provide a class inherited from ``ReleaseHistory``. This base class has\nthe following attributes:\n\n``format``\n List of names for this format. Names from this list can be used\n interchangeably to identify this log format, e.g. as a first\n argument to the ``ReleaseLog`` or derived constructor.\n``filename``\n Name of the file used normally for release logs in this format.\n``header``\n Compiled regular expression that returns a match for\n history entry heading lines. The expression must contain two named\n groups: ``version``, which returns part of the string corresponding\n to the release version number, and ``date``, returning its\n timestamp.\n\n If it contains a named group ``rest``, part of the header string\n corresponding to this group will be added to the ``descr`` list of\n the created history entry.\n\n``end_of_entry_rx``\n Compiled regular expression that matches end of entry. Can be\n ``None``, if not needed.\n\nThe file with the definition of the inherited class must be placed in\nthe directory ``releaselogparser/format`` reachable from the Python search path\nfor module files.\n\nThe following example implements a simplified version of CHANGES.txt log\nformat::\n\n import re\n from releaselogparser import ReleaseHistory\n\n class ChangesLogFormat(ReleaseHistory):\n format = ['changes']\n filename = 'CHANGES.txt'\n header = re.compile(\"\"\"^[vV](?P\\d[\\d.]*)\\s*\n ,\\s*\n (?P.*?)\n \\s+-+\\s*\n (?P.*)$\n \"\"\", re.X)\n\nMore sophisticated implementations can overload the ``parse_header``\nmethod of the parent class. This method is defined as follows::\n\n def parse_header(self, line):\n\nIf the input ``line`` is an entry header, the method should return\na triplet::\n\n (date, version, first_line)\n\nwhere ``date`` is textual representation of the date of the release,\n``version`` is the release version string, and ``first_line`` is the\nfirst line of the description (can be None).\n\nIf the line is not a valid entry header, the method returns\n``(None, None, None)``.\n\n\nThe ``releaselog`` utility\n==========================\nThe ``releaselog`` tool reads release logs in various formats from a\ngiven file or URL. Its usage is::\n\n releaselog [OPTIONS] FILE-or-URL\n\nThe argument is treated as file name by default. To read from a URL,\nuse the ``--url`` option.\n\nOptions:\n\n``-H FORMAT``, ``--format=FORMAT``\n Read logs in the given format.\n``-f N``, ``--from=N``, ``--start=N``\n Start from *N* th entry.\n``-t N``, ``--to=N``, ``--stop=N``\n End on *N* th entry.\n``-n COUNT``, ``--count=COUNT``\n Read at most that much entries.\n``-u``, ``--url``\n Treat argument as URL\n``-l``, ``--list``\n List supported formats\n``--version``\n Show program version number and exit.\n``-h``, ``--help``\n Show a short help message and exit.", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://git.gnu.org.ua/cgit/releaselogparser.git/", "keywords": "release log history changes news", "license": "GPL License", "maintainer": "", "maintainer_email": "", "name": "releaselogparser", "package_url": "https://pypi.org/project/releaselogparser/", "platform": "any", "project_url": "https://pypi.org/project/releaselogparser/", "project_urls": { "Homepage": "http://git.gnu.org.ua/cgit/releaselogparser.git/" }, "release_url": "https://pypi.org/project/releaselogparser/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "Release log parser.", "version": "1.0.2" }, "last_serial": 4453263, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "95100edb6548e805c8c770dab1f599c5", "sha256": "3dbc9ffad211f0c4b8d3cf40afd00a9ab9a1d798ce1ec0c5449616ccf781a507" }, "downloads": -1, "filename": "releaselogparser-1.0.1.tar.gz", "has_sig": false, "md5_digest": "95100edb6548e805c8c770dab1f599c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24560, "upload_time": "2018-10-08T10:16:16", "url": "https://files.pythonhosted.org/packages/8a/e2/16b315e297e6d03d0652beb95d73dd21325adb1efe76cef0ba266b43793d/releaselogparser-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "47a000cd6c807afa00579c4aa4b84db3", "sha256": "6391b56a79d5e9a4187dc13b5e26ee2e85c5ad1c0d5f9efcfd123ae1c771139e" }, "downloads": -1, "filename": "releaselogparser-1.0.2.tar.gz", "has_sig": false, "md5_digest": "47a000cd6c807afa00579c4aa4b84db3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24647, "upload_time": "2018-11-05T15:10:16", "url": "https://files.pythonhosted.org/packages/8d/41/f34c2e672485c57f09de93b84ce76e1abfd404f6fda869c5a1e7205df5ee/releaselogparser-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "47a000cd6c807afa00579c4aa4b84db3", "sha256": "6391b56a79d5e9a4187dc13b5e26ee2e85c5ad1c0d5f9efcfd123ae1c771139e" }, "downloads": -1, "filename": "releaselogparser-1.0.2.tar.gz", "has_sig": false, "md5_digest": "47a000cd6c807afa00579c4aa4b84db3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24647, "upload_time": "2018-11-05T15:10:16", "url": "https://files.pythonhosted.org/packages/8d/41/f34c2e672485c57f09de93b84ce76e1abfd404f6fda869c5a1e7205df5ee/releaselogparser-1.0.2.tar.gz" } ] }