{"id":16505086,"url":"https://github.com/aahnik/verlat","last_synced_at":"2025-07-27T07:41:02.088Z","repository":{"id":62587300,"uuid":"369303913","full_name":"aahnik/verlat","owner":"aahnik","description":"Get info about the latest release of a package on PyPI.","archived":false,"fork":false,"pushed_at":"2021-06-07T12:09:15.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T09:51:19.392Z","etag":null,"topics":["latest-version","poetry","pypi","pypi-package","python","python-package","python3","requests","semantic","semantic-versioning","versioning"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/verlat","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/aahnik.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":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2021-05-20T18:32:40.000Z","updated_at":"2023-03-04T10:03:06.000Z","dependencies_parsed_at":"2022-11-04T07:34:06.139Z","dependency_job_id":null,"html_url":"https://github.com/aahnik/verlat","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aahnik%2Fverlat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aahnik%2Fverlat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aahnik%2Fverlat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aahnik%2Fverlat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aahnik","download_url":"https://codeload.github.com/aahnik/verlat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238578815,"owners_count":19495450,"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":["latest-version","poetry","pypi","pypi-package","python","python-package","python3","requests","semantic","semantic-versioning","versioning"],"created_at":"2024-10-11T15:09:17.050Z","updated_at":"2025-02-13T01:32:18.244Z","avatar_url":"https://github.com/aahnik.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# verlat\n\nGet info about the latest release of a package on PyPI.\n\n[![Code Quality](https://github.com/aahnik/verlat/actions/workflows/quality.yml/badge.svg)](https://github.com/aahnik/verlat/actions/workflows/quality.yml)\n[![Tests](https://github.com/aahnik/verlat/actions/workflows/test.yml/badge.svg)](https://github.com/aahnik/verlat/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/aahnik/verlat/branch/main/graph/badge.svg?token=RO18ZS775L)](https://codecov.io/gh/aahnik/verlat)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/verlat)\n\n## Installation\n\n```shell\npip install --upgrade verlat\n```\n\n## Usage\n\n```python\nfrom verlat import latest_release\n\npackage = \"verlat\" # name of the package on PyPI\nrelease = latest_release(package)\nprint(release.version)\n```\n\n## Application\n\nMany CLI apps like\n[`pip`](https://pip.pypa.io/en/stable/)\nor\n[`gh`](https://cli.github.com/)\nproduce warnings if you are not using their latest release.\n\nUsing `verlat` you can fetch information about the latest release\nof your package on PyPI.\nYou can then compare the version strings of the latest release and\nthe currently running program.\nBased on whether it is a major or minor release, or whatever logic you have,\nyou can log useful information for the user.\n\nFor dealing with version strings, you may use the\n[`packaging`](https://pypi.org/project/packaging/v)\nlibrary.\n\nHere is an example code that demonstrates practical application of `verlat`.\n\n\u003e **NOTE** Assuming that you have build your python package using\n[`poetry`](https://python-poetry.org/docs/),\nand the `version` key exists under `[tool.poetry]` of your\n[`pyproject.toml`](https://python-poetry.org/docs/pyproject/)\nfile.\n\n```python\n# __init__.py\n\nimport logging\nfrom importlib.metadata import version\n\nfrom verlat import latest_release\n\n__version__ = version(__package__)\nlatest = latest_release(__package__)\n\n\ndef major(string):\n    # based on semantic versioning\n    return int(string.split(\".\", 1)[0])\n\n\nif major(__version__) \u003c major(latest.version):\n    logging.warning(\n        f\"A new major release for {__package__} is availaible.\\\n        \\nDownload it from {latest.release_url}\"\n    )\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faahnik%2Fverlat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faahnik%2Fverlat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faahnik%2Fverlat/lists"}