get-pypi-latest-version


Nameget-pypi-latest-version JSON
Version 0.0.12 PyPI version JSON
download
home_pagehttps://github.com/SWHL/GetPyPiLatestVersion
SummaryGet the latest version of the specified python package name in the pypi.
upload_time2023-06-18 14:19:56
maintainer
docs_urlNone
authorSWHL
requires_python>=3.6,<3.12
licenseApache-2.0
keywords pypi latest_version
VCS
bugtrack_url
requirements html5lib requests pip
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## get_pypi_latest_version
<p>
    <a href=""><img src="https://img.shields.io/badge/Python->=3.6,<3.12-aff.svg"></a>
    <a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a>
    <a href="https://pypi.org/project/get_pypi_latest_version/"><img alt="PyPI" src="https://img.shields.io/pypi/v/get_pypi_latest_version"></a>
    <a href="https://pepy.tech/project/get-pypi-latest-version"><img src="https://static.pepy.tech/personalized-badge/get-pypi-latest-version?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=Downloads"></a>
    <a href="https://semver.org/"><img alt="SemVer2.0" src="https://img.shields.io/badge/SemVer-2.0-brightgreen"></a>
<a href='https://getpypilatestversion.readthedocs.io/en/latest/?badge=latest'>
    <img src='https://readthedocs.org/projects/getpypilatestversion/badge/?version=latest' alt='Documentation Status' />
</a>
</p>


### 1. Install package by pypi.
```bash
$ pip install get_pypi_latest_version
```
### 2. Run by command line.
- Usage:
    ```bash
    $ get_pypi_latest_version -h
    usage: get_pypi_latest_version [-h] [-a] package_name

    positional arguments:
    package_name        The specified python package name. e.g. opencv-python.

    optional arguments:
    -h, --help          show this help message and exit
    -a, --all_versions  Whether to return all release versions. Default is
                        False.
    ```
- Example:
    ```bash
    $ get_pypi_latest_version opencv-python
    # 4.7.0.72

    $ get_pypi_latest_version opencv-python -a
    # 4.7.0.72
    # ['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']

    # case: package name error
    $ get_pypi_latest_version opencv
    # ValueError: No version information of opencv-pytho. Please check if the package name correct.
    ```
### 3. Use by python script.
```python
from get_pypi_latest_version import GetPyPiLatestVersion

obtainer = GetPyPiLatestVersion()

package_name = 'opencv-python'
latest_version = obtainer(package_name)
print(latest_version)

result = obtainer(package_name, return_all_versions=True)
latest_version = result[0]
all_versions = result[1]
print(latest_version)
print(all_versions)
```

### Change log
- 2023-04-06 v0.0.10 update:
  - Add unit test and add exception capture.
- 2023-04-03 v0.0.8 update:
  - Add `return_all_versions` parameter.
- 2023-03-26 v0.0.4~5 update:
  - Add [docs](https://getpypilatestversion.readthedocs.io/en/latest/)

### Reference
- [poetry](https://github.com/python-poetry/poetry/blob/master/src/poetry/repositories/pypi_repository.py#L36)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/SWHL/GetPyPiLatestVersion",
    "name": "get-pypi-latest-version",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6,<3.12",
    "maintainer_email": "",
    "keywords": "pypi,latest_version",
    "author": "SWHL",
    "author_email": "liekkaskono@163.com",
    "download_url": "https://github.com/SWHL/GetPyPiLatestVersion.git",
    "platform": "Any",
    "description": "## get_pypi_latest_version\n<p>\n    <a href=\"\"><img src=\"https://img.shields.io/badge/Python->=3.6,<3.12-aff.svg\"></a>\n    <a href=\"\"><img src=\"https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg\"></a>\n    <a href=\"https://pypi.org/project/get_pypi_latest_version/\"><img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/get_pypi_latest_version\"></a>\n    <a href=\"https://pepy.tech/project/get-pypi-latest-version\"><img src=\"https://static.pepy.tech/personalized-badge/get-pypi-latest-version?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=Downloads\"></a>\n    <a href=\"https://semver.org/\"><img alt=\"SemVer2.0\" src=\"https://img.shields.io/badge/SemVer-2.0-brightgreen\"></a>\n<a href='https://getpypilatestversion.readthedocs.io/en/latest/?badge=latest'>\n    <img src='https://readthedocs.org/projects/getpypilatestversion/badge/?version=latest' alt='Documentation Status' />\n</a>\n</p>\n\n\n### 1. Install package by pypi.\n```bash\n$ pip install get_pypi_latest_version\n```\n### 2. Run by command line.\n- Usage:\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- Example:\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\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    # ValueError: No version information of opencv-pytho. Please check if the package name correct.\n    ```\n### 3. Use by python script.\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\n### Change log\n- 2023-04-06 v0.0.10 update:\n  - Add unit test and add exception capture.\n- 2023-04-03 v0.0.8 update:\n  - Add `return_all_versions` parameter.\n- 2023-03-26 v0.0.4~5 update:\n  - Add [docs](https://getpypilatestversion.readthedocs.io/en/latest/)\n\n### Reference\n- [poetry](https://github.com/python-poetry/poetry/blob/master/src/poetry/repositories/pypi_repository.py#L36)\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Get the latest version of the specified python package name in the pypi.",
    "version": "0.0.12",
    "project_urls": {
        "Changelog": "https://github.com/SWHL/GetPyPiLatestVersion#change-log",
        "Documentation": "https://getpypilatestversion.readthedocs.io/",
        "Download": "https://github.com/SWHL/GetPyPiLatestVersion.git",
        "Homepage": "https://github.com/SWHL/GetPyPiLatestVersion",
        "Source": "https://github.com/SWHL/GetPyPiLatestVersion"
    },
    "split_keywords": [
        "pypi",
        "latest_version"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6ff8c9f2a99657f906761c0cfcee63ffae2a9b0956cbf2521e064cc794009118",
                "md5": "44efbbb7be45b6f7770e8d927f0de45a",
                "sha256": "5e9b7d27167c9b68dec55ab4b9d35c815e6caf8fd4f5e9559af6a5dde55e03c9"
            },
            "downloads": -1,
            "filename": "get_pypi_latest_version-0.0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "44efbbb7be45b6f7770e8d927f0de45a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6,<3.12",
            "size": 9771,
            "upload_time": "2023-06-18T14:19:56",
            "upload_time_iso_8601": "2023-06-18T14:19:56.593806Z",
            "url": "https://files.pythonhosted.org/packages/6f/f8/c9f2a99657f906761c0cfcee63ffae2a9b0956cbf2521e064cc794009118/get_pypi_latest_version-0.0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-18 14:19:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SWHL",
    "github_project": "GetPyPiLatestVersion",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "html5lib",
            "specs": [
                [
                    ">=",
                    "1.1"
                ]
            ]
        },
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.28.1"
                ]
            ]
        },
        {
            "name": "pip",
            "specs": [
                [
                    ">=",
                    "21.2"
                ]
            ]
        }
    ],
    "lcname": "get-pypi-latest-version"
}
        
Elapsed time: 0.36985s