{ "info": { "author": "Matthew Planchard", "author_email": "mplanchard@ihiji.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Environment :: Plugins", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Version Control", "Topic :: System :: Software Distribution", "Topic :: Utilities" ], "description": ".. -*- mode: rst; coding: utf-8 -*-\n\n==========================================================\nversion_utils - pure python version parsing and comparison\n==========================================================\n\n:Source: https://github.com/ihiji/version_utils\n:PyPI: https://pypi.python.org/pypi/version_utils\n:Travis: https://travis-ci.org/ihiji/version_utils\n:Maintainer: Matthew Planchard \n:License: GPLv3\n\n.. contents:: Table of Contents\n :backlinks: top\n\nIntroduction\n------------\n\n``version_utils`` is under active development. It is designed to provide a \npure Python convenience library capable of parsing and comparing package and\nversion strings for a variety of packaging standards. Whenever possible,\nthe exact logic of existing package management comparison standards will be\nimplemented so that users can trust that the results are equivalent to what\nthey would get on the command-line.\n\nUsing ``version_utils`` ensures that packages can be compared even on systems\nwithout access to the command line or distro-provided tools on various Linux\nsystems, allowing for easier and more consistent unit testing, safer \ndeployment to multiple distributions, and easier and quicker development due\nto a well-documented API and standardized function calls.\n\nCurrent Status and Roadmap\n--------------------------\n\nCurrently, only RPM/Yum style packages are supported, but we have plans to add\ndpkg/Debian in the near future. Development will probably slow from there, \nalthough Pacman/Arch and various other distributions are on the radar.\n\nNote that the ``compare_versions`` function in the ``rpm`` module will probably\nwork for the majority of ``.deb`` package versions. However, there are some\ndifferences, and it will fail in certain cases. Use at your own risk until\nofficial support for debian version parsing is released.\n\nInstallation\n------------\n\nThis package has no dependencies, so a simple::\n\n pip install version_utils\n\nshould suffice. Feel free to build from source as well, if you prefer.\n\nBasic Use\n---------\n\nCheck the API documentation to ensure the module you are seeking to use is\npresent. The example below uses the ``rpm`` module. From your application::\n\n from subprocess import PIPE, Popen\n from version_utils import rpm\n \n pkg_req = 1.07\n \n # Get a package string for an installed package\n out, err = Popen(['rpm', '-q', 'foo'], stdout=PIPE, stderr=PIPE).communicate()\n sys_pkg_str = out\n \n # Get package information\n sys_package = rpm.package(sys_package)\n sys_pkg_name = sys_package.name\n sys_pkg_version = sys_package.version\n\n # Compare versions\n result = rpm.compare_versions(pkg_req, sys_pkg_version)\n \n if result < 0: # sys_pkg was newer\n print('System package {0} does not satisfy\n requirement!'.format(sys_pkg_name))\n\n\nIn addition to indirectly comparing versions, a ``compare_packages``\nfunction is provided to directly compare package strings, using the\nsame logic as the package manager::\n\n from version_utils import rpm\n\n sys_pkg = 'perl-Compress-Raw-Zlib-2.021-136.el6_6.1.x86_64'\n repo_pkg = 'perl-Compress-Raw-Zlib-2.021-138.el6_6.1.x86_64'\n\n result = rpm.compare_packages(repo_pkg, sys_pkg)\n\n if result > 0: # repo_pkg is newer\n print('Repo package is newer')\n\n\nThe ``Package`` class can be used to succinctly transmit package\ninformation. A factory function, ``rpm.package()``, is provided to\ninstantiate ``Package`` instances::\n\n from version_utils import rpm\n\n pkg_str = 'pkgconfig-0.23-9.1.el6.x86_64'\n pkg = rpm.package(pkg_str)\n\n # Get package name, epoch, version, release, and architecture as a tuple\n print(pkg.info)\n\n # Access the package string that was parsed to make the Package object\n print(pkg.package)\n\n # Access the epoch, version, and release information as a tuple\n print(pkg.evr)\n\n # Access name, epoch, version, release, and architecture independently\n print('Name: {0}, Epoch: {1}, Version: {2}, Release: {3}, Arch:\n {4}'.format(pkg.name, pkg.epoch, pkg.version, pkg.release, pkg.arch))\n\n\nContributing\n------------\n\nContributions to ``version_utils`` are welcome. Feel free to fork, raise\nissues, etc.\n\n\nContributors\n------------\n\nI would like to express my sincere thanks to the following GitHub users for\ntheir contributions to and assistance with this project:\n\n* Joseph Knight (jknightihiji_)\n* Thomas Hoger (thoger_)\n* Marcus Furlong (furlongm_)\n\n.. _jknightihiji: https://github.com/jknightihiji\n.. _thoger: https://github.com/thoger\n.. _furlongm: https://gibhub.com/furlongm\n\n\nChangelog\n---------\n\n0.3.0\n+++++\n\nAdded labelCompare functionality for parity with the official `rpm`\npackage\n\nUpdated tests to use py.test; added more tests\n\nImproved test logging\n\nImproved logging efficiency with `%s` formatting\n\n0.2.3\n+++++\n\nFixed issue `#7`_ where version strings without epoch strings and with multi-\ndigit primary version numbers would return the first digit of the primary\nversion as the epoch and the second digit as the primary version.\n\n.. _#7: https://github.com/ihiji/version_utils/issues/7\n\n0.2.2\n+++++\n\nAdded ``version.py`` with automatic version parsing by ``setup.py``\n\nAdded ``rpm`` and ``common`` modules to ``__init__.py``\n\nImported ``__version__`` and ``__version_info__`` information into\n``__init__.py``\n\nAdded ``tox.ini`` and tox integration\n\nImproved error handling in the ``compare_versions`` function in ``rpm``\n\n0.2.1\n+++++\n\nBugfix release only\n\n0.2.0\n+++++\n\nAdded `common.Package` class and `rpm.package` method to\nreturn a Package object when parsing package strings.\n\nDeprecated public access to the `rpm.parse_package` method, although the\nfunction remains unchanged for backwards compatibility.\n\n0.1.1\n+++++\n\nAdded VersionUtilsError and RpmError classes. RpmError is thrown\nif a package string cannot be parsed. All errors inherit from\nVersionUtilsError\n\n0.1.0\n+++++\n\nInitial release\n\n", "description_content_type": null, "docs_url": "https://pythonhosted.org/version_utils/", "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.github.com/ihiji/version_utils", "keywords": "ihiji version compare parse rpm yum versions comparison utility utilities control distribution", "license": "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "maintainer": "", "maintainer_email": "", "name": "version_utils", "package_url": "https://pypi.org/project/version_utils/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/version_utils/", "project_urls": { "Homepage": "http://www.github.com/ihiji/version_utils" }, "release_url": "https://pypi.org/project/version_utils/0.3.0/", "requires_dist": null, "requires_python": "", "summary": "Library for parsing system package strings and comparing package versions", "version": "0.3.0" }, "last_serial": 2225274, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fd58a51ea31cd15bbb73918d6da98a09", "sha256": "96c7c97fd25692cb1f1b4e9c0badb7ea4002f49850dbeabab66415886d180507" }, "downloads": -1, "filename": "version_utils-0.1.0-cp34-cp34m-macosx_10_6_intel.whl", "has_sig": false, "md5_digest": "fd58a51ea31cd15bbb73918d6da98a09", "packagetype": "bdist_wheel", "python_version": "cp34", "requires_python": null, "size": 4187, "upload_time": "2015-12-17T19:11:49", "url": "https://files.pythonhosted.org/packages/d0/b9/a74f242b7a484554ed2770bce72463b88da487db3a5ad4eee357046752e8/version_utils-0.1.0-cp34-cp34m-macosx_10_6_intel.whl" }, { "comment_text": "", "digests": { "md5": "150efd3b56092a0b823cb5ec19fb8c67", "sha256": "4e5c70fe4792113bfbd21139f731568dc85eb0c656e8f94f7e4ba660459b2eb5" }, "downloads": -1, "filename": "version_utils-0.1.0.tar.gz", "has_sig": false, "md5_digest": "150efd3b56092a0b823cb5ec19fb8c67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2401, "upload_time": "2015-12-17T19:11:55", "url": "https://files.pythonhosted.org/packages/db/f3/5b5bedf325433a77b4e40a714f8398d0603c2643fcd872afb8544722ae6a/version_utils-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f21c374f9f9ea800c82ec73023cd203b", "sha256": "6cfdb5692092ecf98c9e97a669409378976d5d2f945080de090c9a5d39b2b810" }, "downloads": -1, "filename": "version_utils-0.1.1-cp34-cp34m-macosx_10_6_intel.whl", "has_sig": false, "md5_digest": "f21c374f9f9ea800c82ec73023cd203b", "packagetype": "bdist_wheel", "python_version": "cp34", "requires_python": null, "size": 2498, "upload_time": "2015-12-18T15:08:52", "url": "https://files.pythonhosted.org/packages/65/f8/0a18d3b16f9764365fd6fc0f6e4a7e8bd41518c63d1cd33b2f788b7a7ad2/version_utils-0.1.1-cp34-cp34m-macosx_10_6_intel.whl" }, { "comment_text": "", "digests": { "md5": "e8773f1801c43441d0ad1e770258b7fe", "sha256": "e22c96845f9b793148165243d799b063c4ecb407458ec8659286bc210a7520f6" }, "downloads": -1, "filename": "version_utils-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e8773f1801c43441d0ad1e770258b7fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2496, "upload_time": "2015-12-18T15:09:01", "url": "https://files.pythonhosted.org/packages/df/76/333128a4f7b3ae0b32f6dd0f488346087458396ee9e4d22d415221c6c032/version_utils-0.1.1.tar.gz" } ], "0.2.0": [], "0.2.1": [ { "comment_text": "", "digests": { "md5": "548d829bf11afe136479b6c5297ac782", "sha256": "d3bde4cca1cd74e820d58b1d7c291f7a2603e995ea124ed0655baa26940ba122" }, "downloads": -1, "filename": "version_utils-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "548d829bf11afe136479b6c5297ac782", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8660, "upload_time": "2015-12-21T22:16:39", "url": "https://files.pythonhosted.org/packages/db/0c/b418d5b28ff7bd62e7c373f6f93560b619ce59ae4a1323c4f9fac4a0ee5f/version_utils-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bd0ec58f2a4b22be5392ff42de6cd8b6", "sha256": "ff2514dbdd1bc988751a40f4b283cfe382fb8287c2518351bf2cf68fbd178ed5" }, "downloads": -1, "filename": "version_utils-0.2.1.tar.gz", "has_sig": false, "md5_digest": "bd0ec58f2a4b22be5392ff42de6cd8b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8065, "upload_time": "2015-12-21T22:16:48", "url": "https://files.pythonhosted.org/packages/f8/b2/f9b07276499b748cb1426ba3089328f077eafc1178b62596a395dbb7f11e/version_utils-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "33678e2274f93b78421e99e36f761ac1", "sha256": "90b8a4e9f305774e5e5ad79e2a4b9da00e042fe58faf31fb5412fdc335da7740" }, "downloads": -1, "filename": "version_utils-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "33678e2274f93b78421e99e36f761ac1", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9222, "upload_time": "2016-01-13T21:27:08", "url": "https://files.pythonhosted.org/packages/56/c8/fc380f315b2abdfa9517299507c0390fec627b7c689fd49ca2e0f30ec9fe/version_utils-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "43567fba9598a09c6503972b11becac5", "sha256": "4eb9aadd1f51e37ca670fb1949e3a5eb3c55e2fc87cb83129cba7347dfa22cff" }, "downloads": -1, "filename": "version_utils-0.2.2.tar.gz", "has_sig": false, "md5_digest": "43567fba9598a09c6503972b11becac5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8608, "upload_time": "2016-01-13T21:27:15", "url": "https://files.pythonhosted.org/packages/2b/a6/3e77f40f8dc46fc25927575dafb0ee41c1c084cee93d8ce26ddd879bf718/version_utils-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "e0022bd921348a60fefc8f1b3b199762", "sha256": "18a269174f57270a49614547822824aeca4050dd191416c94a1b0d37c62c35ac" }, "downloads": -1, "filename": "version_utils-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e0022bd921348a60fefc8f1b3b199762", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9227, "upload_time": "2016-03-29T15:15:44", "url": "https://files.pythonhosted.org/packages/22/de/7a8493ba1cde556d1682d06febffd52b616bcfec04475cd0d6d3ebf98301/version_utils-0.2.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "de006d0f8559746d539d44346d4da3cb", "sha256": "78ab43eb7a80f4b9072a45463976f24633c0eb2dff8f16c6a1127c53739b832e" }, "downloads": -1, "filename": "version_utils-0.2.3.tar.gz", "has_sig": false, "md5_digest": "de006d0f8559746d539d44346d4da3cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30592, "upload_time": "2016-03-29T15:15:49", "url": "https://files.pythonhosted.org/packages/15/5e/6d5f6e2635e61ba0d3ec9c7d90d1277bec7687b3b144db3509ae97fa14e0/version_utils-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "536f3b99254a415ba36112596ae6babd", "sha256": "0b62b67043b8a8bf86ae282b43ddc6c59b8477bef0c7ef3b120ad66b4d753f3f" }, "downloads": -1, "filename": "version_utils-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "536f3b99254a415ba36112596ae6babd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9466, "upload_time": "2016-07-16T00:21:15", "url": "https://files.pythonhosted.org/packages/c9/a8/079cbdaca5ec0ef3e0a6b820317564ea1717bc1d21558d059a53cd92c146/version_utils-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c7301db62b33fd4970fa54b2cf8ca33", "sha256": "949280808cbed80d5412df73b3ff5d8d067ebedb0771ce406bfad1aa7e95cb61" }, "downloads": -1, "filename": "version_utils-0.3.0.tar.gz", "has_sig": false, "md5_digest": "4c7301db62b33fd4970fa54b2cf8ca33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31368, "upload_time": "2016-07-16T00:21:32", "url": "https://files.pythonhosted.org/packages/d0/65/03dc09013856827ff9fc35f05f721253f6f8af8a3f42392770937505ebac/version_utils-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "536f3b99254a415ba36112596ae6babd", "sha256": "0b62b67043b8a8bf86ae282b43ddc6c59b8477bef0c7ef3b120ad66b4d753f3f" }, "downloads": -1, "filename": "version_utils-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "536f3b99254a415ba36112596ae6babd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9466, "upload_time": "2016-07-16T00:21:15", "url": "https://files.pythonhosted.org/packages/c9/a8/079cbdaca5ec0ef3e0a6b820317564ea1717bc1d21558d059a53cd92c146/version_utils-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c7301db62b33fd4970fa54b2cf8ca33", "sha256": "949280808cbed80d5412df73b3ff5d8d067ebedb0771ce406bfad1aa7e95cb61" }, "downloads": -1, "filename": "version_utils-0.3.0.tar.gz", "has_sig": false, "md5_digest": "4c7301db62b33fd4970fa54b2cf8ca33", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31368, "upload_time": "2016-07-16T00:21:32", "url": "https://files.pythonhosted.org/packages/d0/65/03dc09013856827ff9fc35f05f721253f6f8af8a3f42392770937505ebac/version_utils-0.3.0.tar.gz" } ] }