(dhis2_version)
return api_version
Returns the API version supported by the DHIS2 instance.

    `DHIS 2 Developer guide`_:

        The Web API is versioned starting from DHIS 2.25. The API
        versioning follows the DHIS 2 major version numbering. As an
        example, the API version for DHIS 2.25 is 25.


    .. _DHIS 2 Developer guide: https://docs.dhis2.org/master/en/developer/html/webapi_browsing_the_web_api.html#webapi_api_versions
Returns the API version supported by the DHIS2 instance.
Returns the API version supported by the DHIS2 instance .
def get_api_version(dhis2_version):
    """
    Returns the API version supported by the DHIS2 instance.

    `DHIS 2 Developer guide`_:

        The Web API is versioned starting from DHIS 2.25. The API
        versioning follows the DHIS 2 major version numbering. As an
        example, the API version for DHIS 2.25 is 25.


    .. _DHIS 2 Developer guide: https://docs.dhis2.org/master/en/developer/html/webapi_browsing_the_web_api.html#webapi_api_versions
    """
    try:
        api_version = LooseVersion(dhis2_version).version[1]
    except (AttributeError, IndexError):
        raise Dhis2Exception(f"Unable to parse DHIS2 version {dhis2_version}.")
    return api_version
def get_api_version ( dhis2_version ) : try : api_version = LooseVersion ( dhis2_version ) . version [ 1 ] except ( AttributeError , IndexError ) : raise Dhis2Exception ( f"Unable to parse DHIS2 version {dhis2_version}." ) return api_version