{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# unified-range\n\nThe library converts input semver ranges to a uniform model, and the other way around, providing objects that are easier to use programmatically.\n\n## Examples of supported ranges\n1. npm style semver - `<1.2.3 >=2.0.0`\n2. ruby style semver - `<1.2.3, >=2.0.0`\n3. maven style version ranges - `[1.2.3,2.1.1), [3.0.0,4.1.1)`\n\n\nAdditionally, use this library to run algorithms on any input version ranges and calculate whether a specific version is included in this range.\n\n\n## Prerequisites\n\n1. Ensure you have installed either pip or pipenv\n2. Install:\n `pipenv install unified-range` or `pip install unified-range`\n\n3. Import the `api` module:\n `from unified_range import api`\n\n## How to use\nFollowing are the different functions you can perform with this library.\n\n\n### To convert a range to the uniform string range, from the semver format:\n\n`ver_rng = api.from_semver(semver_str)`\n\nResults: uniform range structure\n\n### Convert from the uniform range structure to a semver string (return str):\n\n`semver = api.to_semver(unified_spec_str)`\n\n\n### To convert the versionrange object to a string:\n\n`version_range_str = str(ver_rng)`\n\n\n### Convert from the uniform string to the uniform model object (VersionRange objects):\n\n`ver_rng = api.unified_range(unified_spec_str)`\n\n```\n>>> api.unified_range('[1.2.3,4.5.6)')\n\n```\n\n### Within a list of ranges, retrieve versions not included:\n\n`filtered_lst = api.filter_versions(ascending_version_list, ranges)`\n```\n>>> api.filter_versions(['0.1', '0.2', '1.0', '1.1', '2.0'], ['[,0.2]', '[1.1]'])\n['1.0', '2.0']\n```\n\n\nThe versions in `ascending_version_list` should be sorted in ascending order,\nfrom oldest to newest, and contain all the versions for the package.\n\n\n### From a list of version ranges, retrieve the closest version in the list to the current version (next):\nFilter next version and maximum version from list of version and ranges:\n\n`next_version = api.next_filtered_version(current_version, ascending_version_list, ranges)`\ncurrent_version must be included in the ascending_version_list.\n```\n>>> api.next_filtered_version(current_version='0.2', ascending_version_list=['0.1', '0.2', '1.0', '1.1', '2.0'], ranges=['[,0.2]', '[1.1]'])\n'1.0'\n\n>>> api.next_filtered_version(current_version='1.1', ascending_version_list=['0.1', '0.2', '1.0', '1.1', '2.0'], ranges=['[,0.2]', '[1.1]'])\n'2.0'\n ```\n\n### Retreive the latest version that is not included:\n`max_version = api.maximum_filtered_version(ascending_version_list, ranges)`\n```\n>>> api.maximum_filtered_version(ascending_version_list=['0.1', '0.2', '1.0', '1.1', '2.0'], ranges=['[,0.2]', '[1.1]'])\n'2.0'\n ```\n\n## Uniform structure examples\n\nFollowing are the uniform structures used in this library:\n\nUniform string structure example: (,1.2.3)\n\n### Uniform model examples:\n\n`UnifiedVersionRange.constraints -> List[Restrictions]`\n\n`Restriction.bounds -> Tuple[Bound, Bound]`\n\n`Bound.version -> str`\n\n`Bound.inclusive -> boolean`\n\n\n## References and prior works\n\nThis library was built with the following:\n1. Maven\u2019s VersionRange:\n[model](https://github.com/apache/maven/tree/master/maven-artifact/src/main/java/org/apache/maven/artifact/versioning) and [spec](https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html) of maven.\n2. https://semver.org/\n3. [npm\u2019s semver library](https://www.npmjs.com/package/semver )", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/snyk/unified-range", "keywords": "", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "unified-range", "package_url": "https://pypi.org/project/unified-range/", "platform": "", "project_url": "https://pypi.org/project/unified-range/", "project_urls": { "Homepage": "https://github.com/snyk/unified-range" }, "release_url": "https://pypi.org/project/unified-range/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Convert between semver range and maven version range", "version": "0.1.0" }, "last_serial": 5680980, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "9dab07d998ce313f2ca0ecc857fe8acc", "sha256": "e0877101be8594efd6857851c021c1e1eb43cdb865dbd910110cb475c513387b" }, "downloads": -1, "filename": "unified_range-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9dab07d998ce313f2ca0ecc857fe8acc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5640, "upload_time": "2018-09-17T09:23:13", "url": "https://files.pythonhosted.org/packages/d7/d0/aecdb2b68068721fb990d82623987aba1eb2e52641326ffebb4540e86a81/unified_range-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "704e3ed3691f4d12cb96db8ab7abf809", "sha256": "655c33616d2def596013c51f613f2425dc038204128cbd389a006188d535972f" }, "downloads": -1, "filename": "unified_range-0.0.1.tar.gz", "has_sig": false, "md5_digest": "704e3ed3691f4d12cb96db8ab7abf809", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4575, "upload_time": "2018-09-17T09:23:14", "url": "https://files.pythonhosted.org/packages/74/2c/f4df3476d73141c9f37eb9cff0dc13bed6540bbb8a2ad32967ef51c1c4fb/unified_range-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "79c63a50f636bc5e702d096da96b9187", "sha256": "c31593dfba6e6b9ef4f83e16db4bd045804bb487fc3f857b30a7506d7fbda3cf" }, "downloads": -1, "filename": "unified_range-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "79c63a50f636bc5e702d096da96b9187", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5657, "upload_time": "2018-09-17T10:45:10", "url": "https://files.pythonhosted.org/packages/33/a2/dbae25c6d1fe543d57eb36c3111ad454e977f503900a87af883f1b7b5057/unified_range-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9a9bb7eb104204116bca61bf4d06219b", "sha256": "a4751549117b054cb7033c9ae3555f1f0eda450e2a2d01271dcff2e3639a4678" }, "downloads": -1, "filename": "unified_range-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9a9bb7eb104204116bca61bf4d06219b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4597, "upload_time": "2018-09-17T10:45:12", "url": "https://files.pythonhosted.org/packages/67/fa/ac0d8b990a19c688c3821ed2f9bbc2648e4ec6c48471f1789be18e8fcf4c/unified_range-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "1333d02fca07cc364bf74e0c9cc55565", "sha256": "05decda17a388ca1ed80c5dd266096eef73ce465d6a895b51c93595841084f1b" }, "downloads": -1, "filename": "unified_range-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "1333d02fca07cc364bf74e0c9cc55565", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5764, "upload_time": "2018-09-17T11:30:37", "url": "https://files.pythonhosted.org/packages/b0/4a/e8adc032d6971254367967196b47128b5e6f0391140857a2a03af85dda4d/unified_range-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "132d05ba3cbb05610ee94471c9754593", "sha256": "63958f3a3db2b631ffe7b2d9d584f364a88e5f96c0170b96327b5bd84409d9e6" }, "downloads": -1, "filename": "unified_range-0.0.3.tar.gz", "has_sig": false, "md5_digest": "132d05ba3cbb05610ee94471c9754593", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4696, "upload_time": "2018-09-17T11:30:38", "url": "https://files.pythonhosted.org/packages/7a/55/bd9787f1853b51cc580197762e3c648dd56b47ea1d827ede906a94437c1b/unified_range-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "80009fad9add4a2f6522ef3a6ac725da", "sha256": "1d7081645dc999699bc3001c562c05b8c74f748b57d495ae8d7acdbb2fdce52d" }, "downloads": -1, "filename": "unified_range-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "80009fad9add4a2f6522ef3a6ac725da", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6563, "upload_time": "2018-11-13T18:06:21", "url": "https://files.pythonhosted.org/packages/59/ef/f3a3d811ba483bba052fae0251fdbf277eed05aabd39af0843b0ae3d99ef/unified_range-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e44862263a829df2dabaa63a469a0b43", "sha256": "124ed2f5f562a712200e1bb76f8666a01a6af52029835b5030f43017463ffa59" }, "downloads": -1, "filename": "unified_range-0.0.4.tar.gz", "has_sig": false, "md5_digest": "e44862263a829df2dabaa63a469a0b43", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4682, "upload_time": "2018-11-13T18:06:23", "url": "https://files.pythonhosted.org/packages/e1/e4/bde0819f8b2d93813f6ea85c31b7c451d1d0cf0a4d5dc24ebd89b69f69d6/unified_range-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "94d5d39c48c7a506ef10ae1a4a9814c7", "sha256": "1fc3191108590d84bee1b6b431bb300e520590adbf7fc8255ff8dcd72516ffa0" }, "downloads": -1, "filename": "unified_range-0.0.5.tar.gz", "has_sig": false, "md5_digest": "94d5d39c48c7a506ef10ae1a4a9814c7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8669, "upload_time": "2019-03-20T08:44:03", "url": "https://files.pythonhosted.org/packages/ec/91/aa87d88d64a3550bbda2672d2bc31d043edd84597180b93ad4bd021d54fd/unified_range-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "576e65ef98192be4fbee2586ca6487d8", "sha256": "b1453228137e106238b21cdcc7cc061d8b95dfbccf5654ebf7ca096707a34dbd" }, "downloads": -1, "filename": "unified_range-0.0.6.tar.gz", "has_sig": false, "md5_digest": "576e65ef98192be4fbee2586ca6487d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8723, "upload_time": "2019-03-31T09:58:11", "url": "https://files.pythonhosted.org/packages/0b/a3/7147878927be8154c62690b3916c10969fe263f0c4e6aca54e9fd603703b/unified_range-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "33e847350b740c53d4e6355f6b6b1df1", "sha256": "6f885602786475a6b79790f8e75cfcd9dca648fdf757d1816ff65a9578007e6c" }, "downloads": -1, "filename": "unified_range-0.0.7.tar.gz", "has_sig": false, "md5_digest": "33e847350b740c53d4e6355f6b6b1df1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8844, "upload_time": "2019-04-02T13:04:10", "url": "https://files.pythonhosted.org/packages/d2/6c/d61df6927d28c2bbc1c6eecb9cbebd5088b3e14637bf9766c6fa716d81c7/unified_range-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "308258e3679967b31556e68e941d2a2a", "sha256": "757aa71626af964c0f2f2dc901990d00cbdfcd20a9dfe8b40fa558276fe943ca" }, "downloads": -1, "filename": "unified_range-0.0.8.tar.gz", "has_sig": false, "md5_digest": "308258e3679967b31556e68e941d2a2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8997, "upload_time": "2019-05-23T10:50:08", "url": "https://files.pythonhosted.org/packages/a3/8c/43547f8ad15ebd1f6b22475522f8bc29c092d39af698cd29c6f52031605f/unified_range-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "54a4bffd238ca119d6264fe49ea57308", "sha256": "1d0c97bf9a52b8307cb2ae368d5cca9f95463163cd0a1456bfccaa3384ad09f7" }, "downloads": -1, "filename": "unified_range-0.0.9.tar.gz", "has_sig": false, "md5_digest": "54a4bffd238ca119d6264fe49ea57308", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9582, "upload_time": "2019-07-30T16:28:10", "url": "https://files.pythonhosted.org/packages/f9/08/a4cf1880b04132d5da3029268413e06af569131a8c27bf8e427ac5404d96/unified_range-0.0.9.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "73f402a6f78689f814419e332edb77dd", "sha256": "49f7862b62a0958f0157be332fc1e12840e1385adaf01a643c65b3b2e6e034ce" }, "downloads": -1, "filename": "unified_range-0.1.0.tar.gz", "has_sig": false, "md5_digest": "73f402a6f78689f814419e332edb77dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11030, "upload_time": "2019-08-15T07:40:02", "url": "https://files.pythonhosted.org/packages/18/65/5502726e0ae9bcde69c60dfaaab0d973f9bf7578757b6b6f300a4d9702f6/unified_range-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "73f402a6f78689f814419e332edb77dd", "sha256": "49f7862b62a0958f0157be332fc1e12840e1385adaf01a643c65b3b2e6e034ce" }, "downloads": -1, "filename": "unified_range-0.1.0.tar.gz", "has_sig": false, "md5_digest": "73f402a6f78689f814419e332edb77dd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11030, "upload_time": "2019-08-15T07:40:02", "url": "https://files.pythonhosted.org/packages/18/65/5502726e0ae9bcde69c60dfaaab0d973f9bf7578757b6b6f300a4d9702f6/unified_range-0.1.0.tar.gz" } ] }