{"id":13464469,"url":"https://github.com/dvershinin/lastversion","last_synced_at":"2025-04-13T01:59:26.780Z","repository":{"id":34887525,"uuid":"187117077","full_name":"dvershinin/lastversion","owner":"dvershinin","description":"Find the latest release version of an arbitrary project","archived":false,"fork":false,"pushed_at":"2025-01-20T16:18:39.000Z","size":1484,"stargazers_count":391,"open_issues_count":18,"forks_count":34,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-13T01:59:18.258Z","etag":null,"topics":["api","cmd","formal-releases","github","github-api","lastversion","linux","pypi","python","python3","shell","version","versions"],"latest_commit_sha":null,"homepage":"https://lastversion.getpagespeed.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvershinin.png","metadata":{"files":{"readme":"README-ZH-CN.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","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},"funding":{"github":"dvershinin"}},"created_at":"2019-05-17T00:00:09.000Z","updated_at":"2025-04-12T15:18:28.000Z","dependencies_parsed_at":"2023-12-30T15:25:00.636Z","dependency_job_id":"3878914e-ae4b-4fbc-9771-3664d46361c3","html_url":"https://github.com/dvershinin/lastversion","commit_stats":{"total_commits":543,"total_committers":15,"mean_commits":36.2,"dds":0.07550644567219156,"last_synced_commit":"b52da681c9130fa8bd084f5e7e3fd4a2b6207b26"},"previous_names":[],"tags_count":102,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvershinin%2Flastversion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvershinin%2Flastversion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvershinin%2Flastversion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvershinin%2Flastversion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvershinin","download_url":"https://codeload.github.com/dvershinin/lastversion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654047,"owners_count":21140235,"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":["api","cmd","formal-releases","github","github-api","lastversion","linux","pypi","python","python3","shell","version","versions"],"created_at":"2024-07-31T14:00:43.781Z","updated_at":"2025-04-13T01:59:26.757Z","avatar_url":"https://github.com/dvershinin.png","language":"Python","funding_links":["https://github.com/sponsors/dvershinin"],"categories":["References","Python","api","shell"],"sub_categories":["Install Nektos Act on Ubuntu Jammy"],"readme":"# lastversion\n\n[![Python package](https://github.com/dvershinin/lastversion/actions/workflows/pythonpackage.yml/badge.svg)](https://github.com/dvershinin/lastversion/actions/workflows/pythonpackage.yml)\n[![PyPI version](https://badge.fury.io/py/lastversion.svg)](https://badge.fury.io/py/lastversion)\n[![Documentation Status](https://readthedocs.org/projects/lastversion/badge/?version=latest)](https://lastversion.getpagespeed.com/en/latest/?badge=latest) \n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/380e3a38dc524112b4dcfc0492d5b816)](https://www.codacy.com/manual/GetPageSpeed/lastversion?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=dvershinin/lastversion\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://app.codacy.com/project/badge/Coverage/380e3a38dc524112b4dcfc0492d5b816)](https://www.codacy.com/gh/dvershinin/lastversion/dashboard?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=dvershinin/lastversion\u0026utm_campaign=Badge_Coverage)\n\n![Using lastversion in terminal](https://www.getpagespeed.com/img/lastversion.gif)\n\n[English](README.md) | 简体中文\n\n一个轻巧的命令行工具，帮助你查询一个项目/软件的最新版本号及各种相关信息，比如下载链接。\n\n`lastversion` 可以从下面的网站找到一个项目的格式良好的最新的版本号。\n\n*   [GitHub](https://github.com/dvershinin/lastversion/wiki/GitHub-specifics)\n*   GitLab\n*   BitBucket\n*   PyPI\n*   Mercurial\n*   SourceForge\n*   Wikipedia\n*   任何以 RSS/ATOM 订阅方式发布软件网站。\n\n## 为什么需要 `lastversion`？\n\n通常情况下，许多项目作者的一些做法会让我们难以寻找一个项目的最新版本及其版本号。\n\n*   发布一个候选版本的时候忘记将其标记为预发布版本，而是作为一个正式版本去发布。比如版本标签为 `v2.0.1-rc` 但是在发布时并未标记为预发布版本。\n*   在版本标签中加入无关的文本，例如 `release-1.2.3` 或 `name-1.2.3-2019`，或者其它类似的文本。\n*   版本标签是否带有 `v` 前缀？今天可能带，但明天可能就不带了。我也是这样的 :)。\n*   切换到另一种版本标签格式，例如从 `v20150121` 切换到 `v2.0.1`。\n\n人与人之间难以保持一致。\n\n有时候我们希望所有的软件都有一个固定格式的版本号，`lastversion` 可以帮助你，它可以让你查询某个项目的最新版本的同时返回一个固定格式的版本号，并可以获取下载链接等额外信息。\n\n`lastversion` 主要用于自动化脚本，比如自动更新和持续集成等。\n\n[就像我这么做](https://www.getpagespeed.com/redhat)\n\n`lastversion` 使用了简单的 AI 来参与到检测中，\n比如清理版本号中的无用信息，比如将 `name-v1.2.3` 修改为 `1.2.3`，\n也用它来检测发布者是否混淆了测试版和稳定版。\n\n\n## 简介\n\n```bash\nlastversion apache/incubator-pagespeed-ngx \n#\u003e 1.13.35.2\n\nlastversion apache/incubator-pagespeed-ngx -d \n#\u003e downloaded incubator-pagespeed-ngx-v1.13.35.2-stable.tar.gz\n\nlastversion apache/incubator-pagespeed-ngx -d pagespeed.tar.gz \n#\u003e downloads with chosen filename\n\nlastversion https://transmissionbt.com/\n#\u003e 3.0\n```\n\n## 在 CentOS/RHEL 7, 8 或 Amazon Linux 2 上安装 `lastversion`\n\n```bash\nsudo yum -y install https://extras.getpagespeed.com/release-latest.rpm\nsudo yum install lastversion\n```\n   \n## 在其它系统上安装 `lastversion`\n\n用 `pip` 安装是最简单的方法。\n\n```bash\npip install lastversion\n```\n    \n## 使用方法\n\n一般来说，`lastversion` 只需要一个参数，即一个仓库的 URL（或 用户名/仓库名），例如：\n\n```bash\nlastversion https://github.com/gperftools/gperftools\n```\n\n与之等价的命令为\n\n```bash\nlastversion gperftools/gperftools\n```    \n\n如果你想偷懒，不想复制粘贴项目的 URL，\n你可以直接使用项目的名字作为参数，这将会使用仓库搜索 API（速度比较慢）。\n\n下面的这条命令可以让你知道 Linux 的最新版本。\n\n```bash\nlastversion linux\n```\n\n或者查询 Wordpress 的最新版本。\n\n```bash\nlastversion wordpress\n```\n\n`self` 是主参数中的一个特殊值，它可以查找 `lastversion` 的最新版本，例如：\n\n```bash\nlastversion self\n```\n\n你可以通过 `--help` 查看和输出控制（行为）相关的选项。 \n\n```text\nusage: lastversion [-h] [--pre] [--verbose] [-d [FILENAME]]\n                   [--format {version,assets,source,json,tag}] [--assets]\n                   [--source] [-gt VER] [-b MAJOR] [--only ONLY]\n                   [--filter REGEX] [-su]\n                   [--at {github,gitlab,bitbucket,pip,hg,sf,website-feed,local}]\n                   [-y] [--version]\n                   [action] \u003crepo or URL\u003e\n\nFind the latest software release.\n\npositional arguments:\n  action                Special action to run, e.g. download, install, test\n  \u003crepo or URL\u003e         GitHub/GitLab/BitBucket/etc. repository in format\n                        owner/name or any URL that belongs to it\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --pre                 Include pre-releases in potential versions\n  --verbose             Will give you an idea of what is happening under the hood\n  -d [FILENAME], --download [FILENAME]\n                        Download with custom filename\n  --format {version,assets,source,json,tag}\n                        Output format\n  --assets              Returns assets download URLs for last release\n  --source              Returns only source URL for last release\n  -gt VER, --newer-than VER\n                        Output only if last version is newer than given\n                        version\n  -b MAJOR, --major MAJOR, --branch MAJOR\n                        Only consider releases of a specific major version,\n                        e.g. 2.1.x\n  --only ONLY           Only consider releases containing this text. Useful\n                        for repos with multiple projects inside\n  --filter REGEX        Filters --assets result by a regular expression\n  --having-asset [ASSET]\n                        Only consider releases with this asset  \n  -su, --shorter-urls   A tiny bit shorter URLs produced\n  --at {github,gitlab,bitbucket,pip,hg,sf,website-feed,local}\n                        If the repo argument is one word, specifies where to\n                        look up the project. The default is via internal\n                        lookup or GitHub Search\n  -y, --assumeyes       Automatically answer yes for all questions\n  --version             show program's version number and exit\n```\n\n`--format` 选项将会指定输出的格式。\n\n*   `version` 默认值，输出格式最新的，格式良好的版本号。\n*   `assets` 会以换行分割的最新版本的 asset 的 URL（如果有多个 asset 的话），否则将为最新源码链接（通常为 *.tar.gz 或 *.zip）。\n*   `source` 将输出最新源码的链接（通常为 *.tar.gz 或 *.zip），即使最新版本同时发布了其它的 asset。\n*   `json` 此格式可以被 Python 程序处理。\n*   `tag` 只输出最新版本的标签名。\n\n`asset` 在本文是指一个可下载的文件，\n一般为可执行文件。例如一个项目发布的时候会连带发布各个平台的可执行程序，让用户无需编译源代码即可使用。\n\n你可以查看最新版本的 asset 或源代码文件的 URL 通过选择适当的 `--format flag`。\n\n你也可以使用 `--source` 去代替 `--format source`，用 `--assets` 代替 `--format assets`，例如：\n\n```bash\nlastversion --assets mautic/mautic \n#\u003e https://github.com/mautic/mautic/archive/2.15.1/mautic-2.15.1.tar.gz\n```\n\n默认情况下， `lastversion` 会根据不同的 OS 过滤掉一些 `--assets` 的输出。\n在 Linux 上谁需要 `.exe` 呢？\n\n你可以使用 `--filter` 来覆盖掉这一行为，\n它使用一个正则表达式作为参数。\n如果你不想根据 OS 过滤掉 asset，你可以直接使用 `--filter` 来匹配所有的asset。\n\n你你可以很优雅地使用 `--filter` 来代替 `grep` 命令，例如：\n```bash\nlastversion --assets --filter win REPO\n```\n\n### 用例: 下载最新版本\n\n你可以使用 `lastversion` 来下载最新版本的 asset 和源代码。\n\n下载最新的 Mautic 源码：\n\n```bash\nlastversion mautic/mautic --download \n```\n    \n自定义下载的文件名（只对下载源代码有效并且此为默认设置）：\n\n```bash\nlastversion mautic/mautic --download mautic.tar.gz\n```  \n\n你也可以使用 `lastversion` 输出源代码或者 asset 的 URL 并下载它，例如：\n\n```bash\nwget $(lastversion --assets mautic/mautic)\n```\n\n上面这行命令会下载所有的最新的稳定版的 asset，即两个 `.zip` 文件。\n\n为什么会这样能够？\n因为 `lastversion` 会输出在两个 `.zip` 文件的 URL 并通过换行分割，`wget` 也很聪明地下载每行的 URL，很神奇吧 :)。\n\n如果最新发布中没有 asset，则会直接下载源代码。\n\n如果你只想下载源代码，你可以使用 `--source`，例如：\n```bash\nwget $(lastversion --source mautic/mautic)  \n```\n\n### 用例: 获取最新版本（含测试版）\n\n`lastversion` 认为最新版本是稳定版本或者没有被标记为测试的版本。\n如果你不这么认为，你可以使用 `--pre` 将预发布版本作为最新版。\n\n```bash\nlastversion --pre mautic/mautic \n#\u003e 2.15.2b0\n```\n\n### 用例: 获取特定的分支/版本\n\n一些项目可能会一起在不同的分支上发布稳定版本，\n典型的例子就是 PHP，你可以使用 `--major` 去指定某个主版本，例如：\n\n```bash\nlastversion php/php-src --major 7.2\n``` \n\n这行命令会输出当前的 PHP 稳定的版本，其版本格式为 `7.2.x`。\n\n你也可以使用下面这种简单的写法来达到几乎相同的效果，即在冒号后指定主版本。\n\n```bash\nlastversion php:7.2\n```\n\n你可以直接指定一个具体的版本，例如：\n\n```bash\nlastversion php:7.2.33 --assets\n```\n\n### 用例：检查是否发布 assets\n\n有时候一个项目可能已经发布了新的版本，但是相关的 assets 并没有第一时间发布，比如各大平台的可执行程序。\n\n如果你只想要某些 assets，你可以使用 `--having-asset` 来实现。\n\n```bash\nlastversion telegramdesktop/tdesktop --having-asset \"Linux 64 bit: Binary\"\n```\n\n`--having-asset` 接收一个正则表达式用于匹配 assets 的名称。\n\n获取包含 macOS 平台的安装程序的最新版本号。\n\n```bash\nlastversion telegramdesktop/tdesktop --having-asset \"~\\.dmg$\"\n```\n\n如果你不为 `--having-asset` 指定任何值，那么将匹配所有 assets，及只要包含任意的 assets 均可。\n\n```bash\nlastversion telegramdesktop/tdesktop --having-asset\n```\n\n### 用例：获取操作系统的版本号\n\n操作系统通常不会在 Github 发布版本，你通常只能通过官方网站等渠道才能获取，\n不过 `lastversion` 可以做到这一点。\n\n`lastversion` 的做法简单粗暴，将常见的操作系统名称及其对应的 Wikipedia 联系起来并硬编码到程序中。\n\n```bash\nlastversion rocky #\u003e 8.4\nlastversion windows #\u003e 10.0.19043.1081\nlastversion ios #\u003e 14.6\n```\n\n你也可以提供某个软件/操作系统的完整的 Wikipedia 的 URL 来完成相同的操作。\n\n```bash\nlastversion https://en.wikipedia.org/wiki/Rocky_Linux #\u003e 8.4\n```\n\n### 特殊用例: NGINX 的稳定版（Stable）和主线版（Mainline）\n\n```bash\nlastversion https://nginx.org --major stable #\u003e 1.16.1\nlastversion https://nginx.org --major mainline #\u003e 1.17.9\n```\n\n上面这行命令其实是检查 `hg.nginx.org`，它是一个 Mercurial 网络仓库。\n\n下面这样也是可以的：\n\n```bash\nlastversion https://hg.example.com/project/\n```\n\nMercurial 仓库现在比较少见，`lastversion` 支持它主要是为了 NGINX。\n\n#### 特殊用例: 获取 PyPI 项目\n\n大多数 Python 的库和应用程序都托管在 PyPI 上。要获取 PyPI 上项目的版本，你可以执行下面的命令。\n\n```bash\nlastversion https://pypi.org/project/requests/\n```\n\n如果您不想写太长的参数，只想写仓库名的话，可以使用`--at pip`，就像下面这样。\n\n```bash\nlastversion requests --at pip\n```\n\n### 安装 RPM 资源\n\n如果一个项目提供 `.rpm` 资源且你的 OS 可以使用 `yum` 或 `dnf`，\n你可以直接安装该项目的 RPM，就像下面这样：\n\n```bash\nsudo lastversion install mailspring\n```\n\n上面这行命令从 [MailSpring](https://github.com/Foundry376/Mailspring) \n的最新版本中找到 `.rpm` 并传递给 `yum` 或 `dnf`。\n\n你甚至可以通过 cron 实现自动更新，这将确保你在某个包为最新版本，就像下面这样：\n \n```bash\n@daily /usr/bin/lastversion install mailspring -y 2\u003e/dev/null\n```\n\n如果 MailSpring 的 Github 仓库发布了一个更新的 `.rpm`，\n那么这个 `.rpm` 会被自动安装，以确保你的版本的最新的。\n\n你甚至可以在更新完毕后收到邮件提醒（cron 的标准功能）。\n  \n不用说都知道，这种方式会导致我们不知道潜在的缺失的依赖。\n所以，只有当 `yum` 库没有你所需要的东西的时候才使用 `lastversion install ...`。\n\n### 测试「版本解析器」\n\n`test` 命令可以用来排除故障或者简单地格式化一个版本标签。\n\n```bash\nlastversion test 'blah-1.2.3-devel' # \u003e 1.2.3.dev0\nlastversion test '1.2.x' # \u003e False (no clear version)\nlastversion test '1.2.3-rc1' # \u003e 1.2.3rc1\n```\n\n### 在 `bash` 上用 `lastversion` 编写脚本\n\n#### 版本号比较\n\n你可以使用 `lastversion` 轻松地比较两个版本号并输出更加新的那个。\n\n```bash\nlastversion 1.2.3 -gt 1.2.4\n#\u003e 1.2.4\n```\n\n#### 检查更新\n\n当你想要构建某个上游的包的时候，而且此时你也有这个包上次构建时的版本号，那么自动构建将会十分容易。\n\n```bash\nCURRENTLY_BUILT_VER=1.2.3 # 存储在其它位置比如文件中\nLASTVER=$(lastversion repo/owner -gt ${CURRENTLY_BUILT_VER})\nif [[ $? -eq 0 ]]; then\n  # 检测到最新版本，触发构建流程。\n  # ....\nfi\n```\n\n注意，`-gt` 参数的功能类似于 `bash` 中的 `-gt` 比较。\n\n还有更多内容，如果你想让这变得更靠谱的话，\n请听我唠叨：\n[RPM auto-builds with `lastversion`](https://github.com/dvershinin/lastversion/wiki/Use-in-RPM-building)\n\n#### 检查你的 Linux 是否有更新的内核版本\n\n```bash\nLATEST_KERNEL=$(lastversion linux -gt $(uname -r | cut -d '-' -f 1))\nif [[ $? -eq 0 ]]; then\n  echo \"I better update my kernel now, because ${LATEST_KERNEL} is there\"\nelse \n  echo \"My kernel is latest and greatest.\"\nfi \n```  \n\n#### 退出状态码\n\n退出状态码是传递命令执行成功与否的常用手段。对于`lastversion` 来说，\n如果命令执行成功则返回 `0`，其它返回值的含义：\n\n返回值 `1` 代表仓库不存在或者没有发布过版本。\n\n返回值 `2` 代表没有比 `-gt` 所指定的版本更新的版本。\n\n返回值 `3` 代表 `--filter` 过滤掉了所有的 URL，即正则表达式没有匹配到任何 URL。\n\n## 小贴士\n\n通过 API 来获取最新版本很难，因为 Github API 不允许按照时间顺序获取 tag，\n而且一些仓库会更换它的版本号格式，所以我们不能认为最高版本号代表着最新版本。\n\n我们必须获取每个标签的提交日期，并检查它是否真的是最近提交的。\n因此，对于大型仓库来说速度会比较慢，因为这些仓库可能有很多标签。\n\n因此，`lastversion` 会缓存的 API 响应内容以提高响应速度，\n它做了有条件的 ETag 验证，根据 GitHub API 的规定，ETag 验证不计入速率限制。\n在 Linux 下缓存内容存储在 `~/.cache/lastversion`。\n\n*建议*设置你的 [GitHub API token](https://github.com/settings/tokens)。\n仅仅只需要 API token，你可以取消这个 Token 的所有权限，\n然后你可以在 `~/.bashrc` 文件中添加下列内容来提升你的请求速度上限。\n\n```bash\nexport GITHUB_API_TOKEN=xxxxxxxxxxxxxxx\n```\n\n`GITHUB_API_TOKEN` 和 `GITHUB_TOKEN` 这两个环境变量均可被识别，\n且当两者同时存在时优先使用前者。\n    \n对于 GitLab, 你可以使用 \n[Personal Access Token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html):\n\n```bash\nexport GITLAB_PA_TOKEN=xxxxxxxxxxxxxxx\n```\n\n然后运行 `source ~/.bashrc`，之后，`lastversion` 将会使用 TOKEN 来更快地调用 API。\n\n## 在 Python 模块中的用法\n\n你可以使用 `lastversion.has_update(...)` 来查找某个项目是否已经有更新。\n\n```python\nfrom lastversion import lastversion\nlatest_version = lastversion.has_update(repo=\"mautic/mautic\", current_version='1.2.3')\nif latest_version:\n    print(f'Newer Mautic version is available: {latest_version}')\nelse:\n    print('No update is available')\n```\n\n`lastversion.has_update(...)` 函数接受一个仓库的 URL，或者形如 `用户名/仓库名` 这样的字符串，第二个参数为当前版本。\n\n如果你要检查 PyPI 上的项目版本，请使用参数 `at='pip'`，\n这样就不用传递一个完整的 PyPI 项目的 URL 了，并且避免错误地从其它平台如 Github 上获取信息。\n下面的示例代码可以检查 `Requests` 最新的版本。\n\n```python\nfrom lastversion import lastversion\nlatest_version = lastversion.has_update(repo=\"requests\", at='pip', current_version='1.2.3')\nif latest_version:\n    print(f'Newer Requests library is available: {latest_version}')\nelse:\n    print('No update is available')\n```\n\n然后它会返回下面的一个返回值：\n\n*   [Version](https://packaging.pypa.io/en/latest/version.html#packaging.version.Version) 对象\n*   `False` 如果没有更加新的版本\n\n你也可以调用 `lastversion.latest(...)` 函数来获取最新版本的信息。\n \n```python\nfrom lastversion import lastversion\nfrom packaging import version\n\nlatest_mautic_version = lastversion.latest(\"mautic/mautic\", output_format='version', pre_ok=True)\n\nprint(f'Latest Mautic version: {latest_mautic_version}')\n\nif latest_mautic_version \u003e= version.parse('1.8.1'):\n    print('It is newer')\n```\n\n如果 `output_format='version'`（默认），函数会返回一个 \n[Version](https://packaging.pypa.io/en/latest/version.html#packaging.version.Version) 对象\n或者 `none`。所以你可以进行如版本比较等工作。\n\n如果指定参数 `output_format='dict'`，\n函数会返回一个 `dict`（字典）或 `False`，\n如果函数从不同的平台（如 Github 和 BitBucket）获取同一个项目的版本信息，\n那么字典的 `Key`（键）可能会不同，\n但可以保证一定会有下列的 `Key`（键）。\n\n*   `version`：[Version](https://packaging.pypa.io/en/latest/version.html#packaging.version.Version) \n\n 对象，包含被找到的版本，如 `1.2.3`。\n\n*   `source`：字符串，表示来源平台, 如 `github` 或  `gitlab`。\n*   `tag_date`：`datetime` 对象, 表示发布的时间，如 `2020-12-15 14:41:39`。\n*   `from`：字符串, 项目的完整 URL。\n*   `tag_name`：字符串，版本标签名。\n\n`lastversion.latest` 函数接受三个参数\n\n*   `repo`，仓库的 URL，或者形如 `用户名/仓库名` 这样的字符串，例如 `https://github.com/dvershinin/lastversion/issues`。\n*   `format`，它接受的值同 `--help` 所说明的一样。不过在 `Python` 代码中还可以指定为 `dict`。\n*   `pre_ok`，布尔值，表示预发布版本是否可以作为最新版本。\n*   `at`，该项目所在的平台，取值仅可能为`github`，`gitlab`，`bitbucket`，`pip`，`hg`，`sf`，`website-feed`，`local`。\n\n[![DeepSource](https://static.deepsource.io/deepsource-badge-light.svg)](https://deepsource.io/gh/dvershinin/lastversion/?ref=repository-badge)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvershinin%2Flastversion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvershinin%2Flastversion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvershinin%2Flastversion/lists"}