{"id":20078524,"url":"https://github.com/timbo-rafa/version","last_synced_at":"2025-03-02T13:14:24.330Z","repository":{"id":57463070,"uuid":"240789799","full_name":"timbo-rafa/version","owner":"timbo-rafa","description":"A version comparator","archived":false,"fork":false,"pushed_at":"2020-02-15T22:24:56.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-28T19:21:43.805Z","etag":null,"topics":["challenges","comparators","demo","executable","nosetests","operator-overloading","pypi","python-module","python-package","python3","test"],"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/timbo-rafa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-15T21:24:09.000Z","updated_at":"2020-05-14T14:40:04.000Z","dependencies_parsed_at":"2022-09-10T23:02:08.956Z","dependency_job_id":null,"html_url":"https://github.com/timbo-rafa/version","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbo-rafa%2Fversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbo-rafa%2Fversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbo-rafa%2Fversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timbo-rafa%2Fversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timbo-rafa","download_url":"https://codeload.github.com/timbo-rafa/version/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241509658,"owners_count":19974071,"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":["challenges","comparators","demo","executable","nosetests","operator-overloading","pypi","python-module","python-package","python3","test"],"created_at":"2024-11-13T15:14:51.923Z","updated_at":"2025-03-02T13:14:24.297Z","avatar_url":"https://github.com/timbo-rafa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Version\n\nA version is a string that matches the following regex:\n```python\n\"^v?(\\d+)(?:.(\\d+))?(?:.(\\d+))?(?:-?(a|b|rc)(\\d+)?)?$\"\n```\nE.g. v0.11.22-rc3.\n\n#### Assumptions\n1. v1 is equivalent to v1.0.0\n2. A version without a candidate is greater than its candidate counterpart\n   e.g. v2 \u003e v2rc \u003e v2b \u003e v2a\n\n## Installation\n\n```\npip install rtimbo-version\n```\n\n## Usage\n\n```python\n\u003e\u003e\u003e from version import Version\n\u003e\u003e\u003e v1 = Version(\"v0.2.11rc3\")\n\u003e\u003e\u003e v1.major\n0\n\u003e\u003e\u003e v1.minor\n2\n\u003e\u003e\u003e v1.patch\n11\n\u003e\u003e\u003e v1.candidate\n'rc'\n\u003e\u003e\u003e v1.candidate_number\n3\n\u003e\u003e\u003e v1 \u003e 0\nTrue\n\u003e\u003e\u003e v1 \u003e 1\nFalse\n```\n\n```python\n\u003e\u003e\u003e available_versions = [\n...     Version(\"v0.9.2b\"),\n...     Version(\"v0.9.1\"),\n...     Version(\"v0.9.2\"),\n...     Version(\"v2.9.3rc1\"),\n...     Version(\"3.0.0\"),\n...     Version(\"v0.9.2a1\"),\n...     Version(\"v0.9.2rc1\"),\n...     Version(\"1.0.0\"),\n...     Version(\"2.5.7\"),\n...     Version(\"v0.9.2rc3\")]\n\u003e\u003e\u003e \n\u003e\u003e\u003e print('\\n'.join([str(version) for version in sorted(available_versions)]))\nv0.9.1\nv0.9.2a1\nv0.9.2b0\nv0.9.2rc1\nv0.9.2rc3\nv0.9.2\nv1.0.0\nv2.5.7\nv2.9.3rc1\nv3.0.0\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimbo-rafa%2Fversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimbo-rafa%2Fversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimbo-rafa%2Fversion/lists"}