{"id":16881420,"url":"https://github.com/swhl/getpypilatestversion","last_synced_at":"2025-09-09T21:47:35.107Z","repository":{"id":146224916,"uuid":"617949573","full_name":"SWHL/GetPyPiLatestVersion","owner":"SWHL","description":"Get the latest version of the direct python package name.","archived":false,"fork":false,"pushed_at":"2024-12-04T00:21:00.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T16:21:32.987Z","etag":null,"topics":["pypi","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SWHL.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-23T12:58:03.000Z","updated_at":"2024-12-04T00:21:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3f8d758-a48b-47cc-9f89-34860fbf08ed","html_url":"https://github.com/SWHL/GetPyPiLatestVersion","commit_stats":{"total_commits":40,"total_committers":1,"mean_commits":40.0,"dds":0.0,"last_synced_commit":"d5b50c8a73d6de213e3b46d2079946900ab80e5f"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SWHL%2FGetPyPiLatestVersion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SWHL%2FGetPyPiLatestVersion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SWHL%2FGetPyPiLatestVersion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SWHL%2FGetPyPiLatestVersion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SWHL","download_url":"https://codeload.github.com/SWHL/GetPyPiLatestVersion/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248473596,"owners_count":21109739,"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":["pypi","python"],"created_at":"2024-10-13T16:02:16.311Z","updated_at":"2025-04-11T20:23:28.254Z","avatar_url":"https://github.com/SWHL.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## get_pypi_latest_version\n\n\u003cp\u003e\n    \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/badge/Python-\u003e=3.6,\u003c3.12-aff.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/get_pypi_latest_version/\"\u003e\u003cimg alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/get_pypi_latest_version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pepy.tech/project/get-pypi-latest-version\"\u003e\u003cimg src=\"https://static.pepy.tech/personalized-badge/get-pypi-latest-version?period=total\u0026units=abbreviation\u0026left_color=grey\u0026right_color=blue\u0026left_text=Downloads\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://semver.org/\"\u003e\u003cimg alt=\"SemVer2.0\" src=\"https://img.shields.io/badge/SemVer-2.0-brightgreen\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/psf/black\"\u003e\u003cimg src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n### 1. Install package by pypi\n\n```bash\npip install get_pypi_latest_version\n```\n\n### 2. Run by command line\n\n- Usage:\n\n    ```bash\n    $ get_pypi_latest_version -h\n    usage: get_pypi_latest_version [-h] [-a] package_name\n\n    positional arguments:\n    package_name        The specified python package name. e.g. opencv-python.\n\n    optional arguments:\n    -h, --help          show this help message and exit\n    -a, --all_versions  Whether to return all release versions. Default is\n                        False.\n    ```\n\n- Example:\n\n    ```bash\n    $ get_pypi_latest_version opencv-python\n    # 4.7.0.72\n\n    $ get_pypi_latest_version opencv-python -a\n    # ['4.7.0.72', '4.7.0.68', '4.6.0.66', '4.5.5.64', '4.5.5.62', '4.5.4.60', '4.5.4.58', '4.5.3.56', '4.5.2.54', '4.5.2.52', '4.5.1.48', '4.4.0.46', '4.4.0.44', '4.4.0.42', '4.4.0.40', '4.3.0.38', '4.3.0.36', '4.2.0.34', '4.2.0.32', '4.1.2.30', '4.1.1.26', '4.1.0.25', '4.0.1.24', '4.0.0.21', '3.4.9.33', '3.4.8.29', '3.4.7.28', '3.4.6.27', '3.4.5.20', '3.4.4.19', '3.4.3.18', '3.4.2.17', '3.4.18.65', '3.4.17.63', '3.4.17.61', '3.4.16.59', '3.4.16.57', '3.4.15.55', '3.4.14.53', '3.4.14.51', '3.4.13.47', '3.4.11.45', '3.4.11.43', '3.4.11.41', '3.4.10.37', '3.4.1.15', '3.4.0.14']\n\n    # case: package name error\n    $ get_pypi_latest_version opencv\n    # get_pypi_latest_version.main.GetPypiLatestVersionError: Not found opencv\n    ```\n\n### 3. Use by python script\n\n```python\nfrom get_pypi_latest_version import GetPyPiLatestVersion\n\nobtainer = GetPyPiLatestVersion()\n\npackage_name = 'opencv-python'\nlatest_version = obtainer(package_name)\nprint(latest_version)\n\nresult = obtainer(package_name, return_all_versions=True)\nlatest_version = result[0]\nall_versions = result[1]\nprint(latest_version)\nprint(all_versions)\n\n# version add one\nlatest_version = '1.4.0'\nnext_version = obtainer.version_add_one(latest_version, add_patch=True)\n# 1.4.1\n\nnext_version = obtainer.version_add_one(latest_version, add_minor=True)\n# 1.5.0\n\nnext_version = obtainer.version_add_one(latest_version, add_major=True)\n# 2.4.0\n\nnext_version = obtainer.version_add_one(latest_version, add_patch=True, add_minor=True, add_major=True)\n# 2.5.1\n```\n\n### Reference\n\n- [poetry](https://github.com/python-poetry/poetry/blob/master/src/poetry/repositories/pypi_repository.py#L36)\n- [funASR](https://github.com/modelscope/FunASR/blob/8b1be8c3cba8987e9993619b46e59039ef3d6560/funasr/utils/version_checker.py)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswhl%2Fgetpypilatestversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswhl%2Fgetpypilatestversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswhl%2Fgetpypilatestversion/lists"}