{"id":15861907,"url":"https://github.com/yakdriver/compatibleversion","last_synced_at":"2026-02-10T17:36:08.192Z","repository":{"id":37863011,"uuid":"216887601","full_name":"YakDriver/compatibleversion","owner":"YakDriver","description":"Compares a version against a specifier to determine compatibility.","archived":false,"fork":false,"pushed_at":"2023-01-16T10:04:34.000Z","size":157,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-07T13:18:43.433Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YakDriver.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-22T18:54:15.000Z","updated_at":"2021-06-01T10:12:23.000Z","dependencies_parsed_at":"2023-02-10T02:31:22.733Z","dependency_job_id":null,"html_url":"https://github.com/YakDriver/compatibleversion","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YakDriver%2Fcompatibleversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YakDriver%2Fcompatibleversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YakDriver%2Fcompatibleversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YakDriver%2Fcompatibleversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YakDriver","download_url":"https://codeload.github.com/YakDriver/compatibleversion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709932,"owners_count":20821297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-05T22:21:06.868Z","updated_at":"2026-02-10T17:36:03.170Z","avatar_url":"https://github.com/YakDriver.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/github/license/YakDriver/compatibleversion.svg)](./LICENSE)\n[![Travis CI Build Status](https://travis-ci.org/YakDriver/compatibleversion.svg)](https://travis-ci.org/YakDriver/compatibleversion)\n[![Latest Version](https://img.shields.io/pypi/v/compatibleversion.svg?label=version)](https://pypi.python.org/pypi/compatibleversion)\n\n# compatibleversion\n\n*compatibleversion* takes two parameters, a version and a specifier (i.e., version constraints), and returns a Boolean value indicating compatibility.\n\n**NOTE:** *compatibleversion* wraps [packaging](https://packaging.pypa.io/en/latest/) in order to simplify and test its use. Versions and specifiers provided to *compatibleversion* must conform to [PEP 440](https://www.python.org/dev/peps/pep-0440/) as required by *packaging*.\n\n## install\n\n```console\n$ pip install compatibleversion\n```\n\n## usage\n\nUse *compatibleversion* in Python code:\n\n```python\nfrom compatibleversion import check_version\n\ncheck_version('1.3.0', '\u003e 1.2, \u003c 3.3')          # True\ncheck_version('2.1', '~= 2.2')                  # False\n\ncheck_version('1.1.dev0', '\u003e=1.0')              # True\ncheck_version('1.1.dev0', '\u003e=1.0', False)       # False, not allowing pre/dev-final comparison\n\ncheck_version('1.1.dev0', '\u003e=1.0.dev0')         # True, dev-dev compare\ncheck_version('1.1.dev0', '\u003e=1.0.dev0', False)  # True, doesn't affect since dev-dev\n```\n\n## version parameter\n\nThe version parameter must conform to [PEP 440](https://www.python.org/dev/peps/pep-0440/). These are examples of valid version parameters:\n\n```\n1.2.0\n0.0.0\n0.9\n0.9.1\n0.9.2\n0.9.10\n0.9.11\n1.0\n1.0.1\n1.1\n2.0\n2.0.1\n1.0a1\n1.0a2\n1.0b1\n1.0rc1\n1.0.dev1\n1.0.dev2\n1.0.dev3\n1.0.dev4\n1.0b2.post345.dev456\n1.0b2.post345\n1.0rc1.dev456\n```\n\n## specifier parameter\n\nThe version specifier parameter must conform to [PEP 440](https://www.python.org/dev/peps/pep-0440/). The specifier consists of one or more version clauses separated by commas.\n\nFor example, these are valid version specifiers (the last two are approximately equivalent):\n\n```\n==1.0.1\n\u003c 1.2, \u003e 1.3\n~= 0.9, \u003e= 1.0, != 1.3.4.*, \u003c 2.0\n~= 1.4.5.0\n== 1.1.post1\n~= 2.2\n\u003e= 2.2, == 2.*\n```\n\nHere are more helpful specifier examples from [PEP 440](https://www.python.org/dev/peps/pep-0440/) and an explanation of their meaning:\n\n* `~=3.1`: version 3.1 or later, but not version 4.0 or later.\n* `~=3.1.2`: version 3.1.2 or later, but not version 3.2.0 or later.\n* `~=3.1a1`: version 3.1a1 or later, but not version 4.0 or later.\n* `== 3.1`: specifically version 3.1 (or 3.1.0), excludes all pre-releases, post releases, developmental releases and any 3.1.x maintenance releases.\n* `== 3.1.*`: any version that starts with 3.1. Equivalent to the ~=3.1.0 compatible release clause.\n* `~=3.1.0, != 3.1.3`: version 3.1.0 or later, but not version 3.1.3 and not version 3.2.0 or later.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyakdriver%2Fcompatibleversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyakdriver%2Fcompatibleversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyakdriver%2Fcompatibleversion/lists"}