Skip to main content

version-tracker

https://img.shields.io/pypi/v/version_tracker.svg https://img.shields.io/travis/prabhakk-mw/version_tracker.svg 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:

  1. MAJOR version when you make incompatible API changes

  2. MINOR version when you add functionality in a backward compatible manner

  3. PATCH version when you make backward compatible bug fixes

APIs

  1. High Level API

    def get_update_notification(pkg_name: str, severity_level: int = 2) -> str:
  2. Low Level API

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

How to use version-tracker

  1. Add version-tracker to the list of your package’s dependencies.

    # Update your SETUP.PY to include version-tracker as shown:
    INSTALL_REQUIRES = [
            "aiohttp>=3.7.4",
            "psutil",
            "aiohttp_session[secure]",
            "version-tracker",
            ]
  2. Include the module from your source code and use the APIs provided. See example below:

    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("==============")
  3. 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

    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:==============

History

0.1.0 (2023-11-23)

  • First release on PyPI.

Metadata

Release files for version-tracker 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for version-tracker 0.2.1
File Size Uploaded Provenance
version_tracker-0.2.1.tar.gz 14.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for version-tracker 0.2.1
File Interpreter ABI Platform
version_tracker-0.2.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 21.1 kB

Release files / version_tracker-0.2.1.tar.gz

Download URL version_tracker-0.2.1.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
753a710ea92e5cb548acb060eef1f2abedb6eaedec8d718950971da8817f33bc
BLAKE2b-256 checksum
How to use checksums
321455bb8d1b29dd4ed5e564fe41ba6e63c5db0a8c2e945595a5d181e27bf715
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / version_tracker-0.2.1-py2.py3-none-any.whl

Download URL version_tracker-0.2.1-py2.py3-none-any.whl
Size 7.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
207b45624177ca7daae2c7bf578ff38da3ae53ead0a9715a63199d6a6a7ecb95
BLAKE2b-256 checksum
How to use checksums
d04401e44748134b6bbe0a3e5a22031cd25ce991fe701d79f80bb680e123ad48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Security for version-tracker 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page