def split_name_version(name):
 prefix = ''
 if (name[0] in ['-', '~', '+']):
  prefix = name[0]
  name = name[1:]
 version_check = re.compile('^(.*?)((?:<|>|<=|>=|=)[0-9.-]*)?$')
 try:
  reres = version_check.match(name)
  (name, version) = reres.groups()
  return (prefix, name, version)
 except:
  return (prefix, name, None)

def split_name_version ( name ) : prefix = '' if ( name [ 0 ] in [ '-' , '~' , '+' ] ) : prefix = name [ 0 ] name = name [ 1 : ] version_check = re . compile ( '^(.*?)((?:<|>|<=|>=|=)[0-9.-]*)?$' ) try : reres = version_check . match ( name ) ( name , version ) = reres . groups ( ) return ( prefix , name , version ) except : return ( prefix , name , None )
splits of the package name and desired version example formats: - docker>=1 .