def _version_to_string(version):
    """Creates a version string according to PEP-440

       For additional information, please
       see https://www.python.org/dev/peps/pep-0440/#version-scheme

        Args:
            version: An instance of a Version namedtuple

        Returns:
            A string created from the Version tuple, formatted according
            to PEP-440
            example:

            '0.0.1.dev.b1'
    """
    s1 = '.' if version.pre_tags else ''
    s2 = '.' if version.pre_tags else ''
    v = f'.'.join([str(getattr(version, f'{field}'))
                   for field in version._fields
                   if field in ('major', 'minor', 'micro')]) + \
        f'{s1}' + f'.'.join([tag for tag in version.pre_tags]) + \
        f'{s2}{version.post_tag}'

    return v