version-tracker


Nameversion-tracker JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/prabhakk-mw/version_tracker
SummaryQuery PyPI for critical updates available available for your users installation of your package.
upload_time2023-11-24 07:06:23
maintainer
docs_urlNone
authorPrabhakar Kumar
requires_python>=3.6
licenseMIT license
keywords version_tracker
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ===============
version-tracker
===============


.. image:: https://img.shields.io/pypi/v/version_tracker.svg
        :target: https://pypi.python.org/pypi/version_tracker

.. image:: https://img.shields.io/travis/prabhakk-mw/version_tracker.svg
        :target: https://travis-ci.com/prabhakk-mw/version_tracker

.. image:: https://readthedocs.org/projects/version-tracker/badge/?version=latest
        :target: https://version-tracker.readthedocs.io/en/latest/?version=latest
        :alt: Documentation Status




Query PyPI for critical updates available available for your users installation of your package.

Details
---------

Import this Python package into your Python packages to query PyPI for critical updates to your package.

This is particularly useful when you would like to notify your users that the version of your package, 
that they have installed has critical updates that they should update their package.

Requirements
-------------
Your package must follow Semantic Versioning.

Given a version number MAJOR.MINOR.PATCH, increment the:

#. MAJOR version when you make incompatible API changes
#. MINOR version when you add functionality in a backward compatible manner
#. PATCH version when you make backward compatible bug fixes

APIs
-----

#. High Level API

    .. code-block:: python

        def get_update_notification(pkg_name: str, severity_level: int = 2) -> str:

#. Low Level API

    .. code-block:: python

        def query(pkg_name: str) -> dict[str, str]:


How to use version-tracker
--------------------------

#. Add version-tracker to the list of your package's dependencies.

    .. code-block:: python

        # Update your SETUP.PY to include version-tracker as shown:
        INSTALL_REQUIRES = [
                "aiohttp>=3.7.4",
                "psutil",
                "aiohttp_session[secure]",
                "version-tracker",
                ]

#. Include the module from your source code and use the APIs provided. See example below:

    .. code-block:: python

        import version_tracker

            logger.info("==============")
            # Get the name of your own package
            package_name = str(__name__).split(".")[0]

            # Returns a pre-formatted string for use with any logging information, that can be used to warn users of available updates.
            logger.info("HIGH SEVERITY LEVEL log:")
            logger.info(
                    version_tracker.get_update_notification(
                    package_name, version_tracker.HIGH_SEVERITY_LEVEL
                    )
            )

            logger.info("MEDIUM SEVERITY LEVEL log:")
            logger.info(
                    version_tracker.get_update_notification(
                    package_name, version_tracker.MEDIUM_SEVERITY_LEVEL
                    )
            )

            logger.info("LOW SEVERITY LEVEL log:")
            logger.info(
                    version_tracker.get_update_notification(
                    package_name, version_tracker.LOW_SEVERITY_LEVEL
                    )
            )

            # Low Level API:
            # Returns version information about the current package.
            version_info = version_tracker.query(package_name)

            # version_info is a Dictionary with the following information:
            #  "latest": latest_version,
            #  "is_major": str(major_update),
            #  "is_minor": str(minor_update),
            #  "is_patch": str(patch_update),
            #  "commit_messages": commit_msg,

            # Shows the latest version of your package that is available on PyPI
            print(version_info["latest"])

            # Shows whether the updates on PyPI are major in Nature. ie: Update found in the MAJOR portion of the Semantic version.
            print(version_info["is_major"])

            # Shows any available commit messages related the updates between installed version and latest version.
            print(version_info["commit_messages"])
            logger.info("==============")

#. Sample output from a package that is using the Above APIs and run on an installation which has version 0.1.0, but PyPI has version 0.10.0 installed

    .. code-block:: bash

                INFO:MATLABProxyApp:HIGH SEVERITY LEVEL log:
                severity_level requested: 2
                Local version found for [matlab_proxy] is: [0.1.0]
                fetching: https://api.github.com/repos/mathworks/matlab-proxy/releases/tags/v0.10.0
                INFO:MATLABProxyApp:
                ====!!!! ATTENTION !!!!====
                Major Update required for matlab_proxy.
                Consider updating to v0.10.0.
                Commit message of v0.10.0: 
                        Contains multiple bug fixes and critical vulnerability patches.
                Also introduces the ability to control the time for which matlab-proxy waits before timing out. See MWI_PROCESS_START_TIMEOUT in [Advanced-Usage.md](https://github.com/mathworks/matlab-proxy/blob/main/Advanced-Usage.md).
                **Full Changelog**: https://github.com/mathworks/matlab-proxy/compare/v0.9.1...v0.10.0
                ====!!!! ATTENTION !!!!====

                INFO:MATLABProxyApp:MEDIUM SEVERITY LEVEL log:
                severity_level requested: 1
                Local version found for [matlab_proxy] is: [0.1.0]
                fetching: https://api.github.com/repos/mathworks/matlab-proxy/releases/tags/v0.10.0
                INFO:MATLABProxyApp:
                ====!!!! ATTENTION !!!!====
                Major Update required for matlab_proxy.
                Consider updating to v0.10.0.
                Commit message of v0.10.0: 
                        Contains multiple bug fixes and critical vulnerability patches.
                Also introduces the ability to control the time for which matlab-proxy waits before timing out. See MWI_PROCESS_START_TIMEOUT in [Advanced-Usage.md](https://github.com/mathworks/matlab-proxy/blob/main/Advanced-Usage.md).
                **Full Changelog**: https://github.com/mathworks/matlab-proxy/compare/v0.9.1...v0.10.0
                ====!!!! ATTENTION !!!!====

                INFO:MATLABProxyApp:LOW SEVERITY LEVEL log:
                severity_level requested: 0
                Local version found for [matlab_proxy] is: [0.1.0]
                fetching: https://api.github.com/repos/mathworks/matlab-proxy/releases/tags/v0.10.0
                INFO:MATLABProxyApp:
                ====!!!! ATTENTION !!!!====
                Major Update required for matlab_proxy.
                Consider updating to v0.10.0.
                Commit message of v0.10.0: 
                        Contains multiple bug fixes and critical vulnerability patches.
                Also introduces the ability to control the time for which matlab-proxy waits before timing out. See MWI_PROCESS_START_TIMEOUT in [Advanced-Usage.md](https://github.com/mathworks/matlab-proxy/blob/main/Advanced-Usage.md).
                **Full Changelog**: https://github.com/mathworks/matlab-proxy/compare/v0.9.1...v0.10.0
                ====!!!! ATTENTION !!!!====

                Local version found for [matlab_proxy] is: [0.1.0]
                fetching: https://api.github.com/repos/mathworks/matlab-proxy/releases/tags/v0.10.0
                0.10.0
                False
                Contains multiple bug fixes and critical vulnerability patches.
                Also introduces the ability to control the time for which matlab-proxy waits before timing out. See MWI_PROCESS_START_TIMEOUT in [Advanced-Usage.md](https://github.com/mathworks/matlab-proxy/blob/main/Advanced-Usage.md).
                **Full Changelog**: https://github.com/mathworks/matlab-proxy/compare/v0.9.1...v0.10.0
                INFO:MATLABProxyApp:==============

* Free software: MIT license
* Documentation: https://version-tracker.readthedocs.io.





=======
History
=======

0.1.0 (2023-11-23)
------------------

* First release on PyPI.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/prabhakk-mw/version_tracker",
    "name": "version-tracker",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "version_tracker",
    "author": "Prabhakar Kumar",
    "author_email": "prabhakk@mathworks.com",
    "download_url": "https://files.pythonhosted.org/packages/32/14/55bb8d1b29dd4ed5e564fe41ba6e63c5db0a8c2e945595a5d181e27bf715/version_tracker-0.2.1.tar.gz",
    "platform": null,
    "description": "===============\nversion-tracker\n===============\n\n\n.. image:: https://img.shields.io/pypi/v/version_tracker.svg\n        :target: https://pypi.python.org/pypi/version_tracker\n\n.. image:: https://img.shields.io/travis/prabhakk-mw/version_tracker.svg\n        :target: https://travis-ci.com/prabhakk-mw/version_tracker\n\n.. image:: https://readthedocs.org/projects/version-tracker/badge/?version=latest\n        :target: https://version-tracker.readthedocs.io/en/latest/?version=latest\n        :alt: Documentation Status\n\n\n\n\nQuery PyPI for critical updates available available for your users installation of your package.\n\nDetails\n---------\n\nImport this Python package into your Python packages to query PyPI for critical updates to your package.\n\nThis is particularly useful when you would like to notify your users that the version of your package, \nthat they have installed has critical updates that they should update their package.\n\nRequirements\n-------------\nYour package must follow Semantic Versioning.\n\nGiven a version number MAJOR.MINOR.PATCH, increment the:\n\n#. MAJOR version when you make incompatible API changes\n#. MINOR version when you add functionality in a backward compatible manner\n#. PATCH version when you make backward compatible bug fixes\n\nAPIs\n-----\n\n#. High Level API\n\n    .. code-block:: python\n\n        def get_update_notification(pkg_name: str, severity_level: int = 2) -> str:\n\n#. Low Level API\n\n    .. code-block:: python\n\n        def query(pkg_name: str) -> dict[str, str]:\n\n\nHow to use version-tracker\n--------------------------\n\n#. Add version-tracker to the list of your package's dependencies.\n\n    .. code-block:: python\n\n        # Update your SETUP.PY to include version-tracker as shown:\n        INSTALL_REQUIRES = [\n                \"aiohttp>=3.7.4\",\n                \"psutil\",\n                \"aiohttp_session[secure]\",\n                \"version-tracker\",\n                ]\n\n#. Include the module from your source code and use the APIs provided. See example below:\n\n    .. code-block:: python\n\n        import version_tracker\n\n            logger.info(\"==============\")\n            # Get the name of your own package\n            package_name = str(__name__).split(\".\")[0]\n\n            # Returns a pre-formatted string for use with any logging information, that can be used to warn users of available updates.\n            logger.info(\"HIGH SEVERITY LEVEL log:\")\n            logger.info(\n                    version_tracker.get_update_notification(\n                    package_name, version_tracker.HIGH_SEVERITY_LEVEL\n                    )\n            )\n\n            logger.info(\"MEDIUM SEVERITY LEVEL log:\")\n            logger.info(\n                    version_tracker.get_update_notification(\n                    package_name, version_tracker.MEDIUM_SEVERITY_LEVEL\n                    )\n            )\n\n            logger.info(\"LOW SEVERITY LEVEL log:\")\n            logger.info(\n                    version_tracker.get_update_notification(\n                    package_name, version_tracker.LOW_SEVERITY_LEVEL\n                    )\n            )\n\n            # Low Level API:\n            # Returns version information about the current package.\n            version_info = version_tracker.query(package_name)\n\n            # version_info is a Dictionary with the following information:\n            #  \"latest\": latest_version,\n            #  \"is_major\": str(major_update),\n            #  \"is_minor\": str(minor_update),\n            #  \"is_patch\": str(patch_update),\n            #  \"commit_messages\": commit_msg,\n\n            # Shows the latest version of your package that is available on PyPI\n            print(version_info[\"latest\"])\n\n            # Shows whether the updates on PyPI are major in Nature. ie: Update found in the MAJOR portion of the Semantic version.\n            print(version_info[\"is_major\"])\n\n            # Shows any available commit messages related the updates between installed version and latest version.\n            print(version_info[\"commit_messages\"])\n            logger.info(\"==============\")\n\n#. Sample output from a package that is using the Above APIs and run on an installation which has version 0.1.0, but PyPI has version 0.10.0 installed\n\n    .. code-block:: bash\n\n                INFO:MATLABProxyApp:HIGH SEVERITY LEVEL log:\n                severity_level requested: 2\n                Local version found for [matlab_proxy] is: [0.1.0]\n                fetching: https://api.github.com/repos/mathworks/matlab-proxy/releases/tags/v0.10.0\n                INFO:MATLABProxyApp:\n                ====!!!! ATTENTION !!!!====\n                Major Update required for matlab_proxy.\n                Consider updating to v0.10.0.\n                Commit message of v0.10.0: \n                        Contains multiple bug fixes and critical vulnerability patches.\n                Also introduces the ability to control the time for which matlab-proxy waits before timing out. See MWI_PROCESS_START_TIMEOUT in [Advanced-Usage.md](https://github.com/mathworks/matlab-proxy/blob/main/Advanced-Usage.md).\n                **Full Changelog**: https://github.com/mathworks/matlab-proxy/compare/v0.9.1...v0.10.0\n                ====!!!! ATTENTION !!!!====\n\n                INFO:MATLABProxyApp:MEDIUM SEVERITY LEVEL log:\n                severity_level requested: 1\n                Local version found for [matlab_proxy] is: [0.1.0]\n                fetching: https://api.github.com/repos/mathworks/matlab-proxy/releases/tags/v0.10.0\n                INFO:MATLABProxyApp:\n                ====!!!! ATTENTION !!!!====\n                Major Update required for matlab_proxy.\n                Consider updating to v0.10.0.\n                Commit message of v0.10.0: \n                        Contains multiple bug fixes and critical vulnerability patches.\n                Also introduces the ability to control the time for which matlab-proxy waits before timing out. See MWI_PROCESS_START_TIMEOUT in [Advanced-Usage.md](https://github.com/mathworks/matlab-proxy/blob/main/Advanced-Usage.md).\n                **Full Changelog**: https://github.com/mathworks/matlab-proxy/compare/v0.9.1...v0.10.0\n                ====!!!! ATTENTION !!!!====\n\n                INFO:MATLABProxyApp:LOW SEVERITY LEVEL log:\n                severity_level requested: 0\n                Local version found for [matlab_proxy] is: [0.1.0]\n                fetching: https://api.github.com/repos/mathworks/matlab-proxy/releases/tags/v0.10.0\n                INFO:MATLABProxyApp:\n                ====!!!! ATTENTION !!!!====\n                Major Update required for matlab_proxy.\n                Consider updating to v0.10.0.\n                Commit message of v0.10.0: \n                        Contains multiple bug fixes and critical vulnerability patches.\n                Also introduces the ability to control the time for which matlab-proxy waits before timing out. See MWI_PROCESS_START_TIMEOUT in [Advanced-Usage.md](https://github.com/mathworks/matlab-proxy/blob/main/Advanced-Usage.md).\n                **Full Changelog**: https://github.com/mathworks/matlab-proxy/compare/v0.9.1...v0.10.0\n                ====!!!! ATTENTION !!!!====\n\n                Local version found for [matlab_proxy] is: [0.1.0]\n                fetching: https://api.github.com/repos/mathworks/matlab-proxy/releases/tags/v0.10.0\n                0.10.0\n                False\n                Contains multiple bug fixes and critical vulnerability patches.\n                Also introduces the ability to control the time for which matlab-proxy waits before timing out. See MWI_PROCESS_START_TIMEOUT in [Advanced-Usage.md](https://github.com/mathworks/matlab-proxy/blob/main/Advanced-Usage.md).\n                **Full Changelog**: https://github.com/mathworks/matlab-proxy/compare/v0.9.1...v0.10.0\n                INFO:MATLABProxyApp:==============\n\n* Free software: MIT license\n* Documentation: https://version-tracker.readthedocs.io.\n\n\n\n\n\n=======\nHistory\n=======\n\n0.1.0 (2023-11-23)\n------------------\n\n* First release on PyPI.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "Query PyPI for critical updates available available for your users installation of your package.",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/prabhakk-mw/version_tracker"
    },
    "split_keywords": [
        "version_tracker"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d04401e44748134b6bbe0a3e5a22031cd25ce991fe701d79f80bb680e123ad48",
                "md5": "3a73b7a160f1e2279f2cfa66a23258ca",
                "sha256": "207b45624177ca7daae2c7bf578ff38da3ae53ead0a9715a63199d6a6a7ecb95"
            },
            "downloads": -1,
            "filename": "version_tracker-0.2.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3a73b7a160f1e2279f2cfa66a23258ca",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 7067,
            "upload_time": "2023-11-24T07:06:21",
            "upload_time_iso_8601": "2023-11-24T07:06:21.730076Z",
            "url": "https://files.pythonhosted.org/packages/d0/44/01e44748134b6bbe0a3e5a22031cd25ce991fe701d79f80bb680e123ad48/version_tracker-0.2.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "321455bb8d1b29dd4ed5e564fe41ba6e63c5db0a8c2e945595a5d181e27bf715",
                "md5": "30d9e254dadcef466f930f9aa6663271",
                "sha256": "753a710ea92e5cb548acb060eef1f2abedb6eaedec8d718950971da8817f33bc"
            },
            "downloads": -1,
            "filename": "version_tracker-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "30d9e254dadcef466f930f9aa6663271",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 14028,
            "upload_time": "2023-11-24T07:06:23",
            "upload_time_iso_8601": "2023-11-24T07:06:23.407595Z",
            "url": "https://files.pythonhosted.org/packages/32/14/55bb8d1b29dd4ed5e564fe41ba6e63c5db0a8c2e945595a5d181e27bf715/version_tracker-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-24 07:06:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "prabhakk-mw",
    "github_project": "version_tracker",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "version-tracker"
}
        
Elapsed time: 0.38964s