utm2dd/utm2dd.py
def string_transform(utm_string, easting_northing=True):
    """Parse UTM coordinate string into a Latitude/Longitude Tuple
    
    Parameters
    ----------
    utm_string : str
        UTM coordinate string. Format as: "10M 551884.29mE 5278575.64mN"
    easting_northing : bool, optional
        Default=True. Set to False if UTM is formated with mN before mE.

    Returns
    -------
    tuple
        (Latitude, Longitude)
    """
    utm_strip = utm_string.strip()#remove leading or trailing spaces
    split_UTM = utm_strip.split() #string split the UTM elements
    
    zone_num = float(split_UTM[0][:2]) #turn the zone number into a number
    zone_let = str(split_UTM[0][2:]) #turn the zone letter into its own letter
    
    if easting_northing == True: #formated by convention
        easting = float(split_UTM[1][:-2]) 
        northing = float(split_UTM[2][:-2])

    elif easting_northing == False: #flipped the easting and northing
        northing = float(split_UTM[1][:-2]) 
        easting = float(split_UTM[2][:-2])
    
    #turn into latlon
    latlong = utm.to_latlon(easting,northing,zone_num,zone_let)
    
    return latlong
Parse UTM coordinate string into a Latitude/Longitude Tuple
    
    Parameters
    ----------
    utm_string : str
        UTM coordinate string. Format as: "10M 551884.29mE 5278575.64mN"
    easting_northing : bool, optional
        Default=True. Set to False if UTM is formated with mN before mE.

    Returns
    -------
    tuple
        (Latitude, Longitude)
    
Parse UTM coordinate string into a Latitude/Longitude Tuple
Parse UTM coordinate string into a Latitude / Longitude Tuple
def string_transform(utm_string, easting_northing=True):
    utm_strip = utm_string.strip()
    split_UTM = utm_strip.split() 
    zone_num = float(split_UTM[0][:2]) 
    zone_let = str(split_UTM[0][2:]) 
    if easting_northing == True: 
        easting = float(split_UTM[1][:-2]) 
        northing = float(split_UTM[2][:-2])
    elif easting_northing == False: 
        northing = float(split_UTM[1][:-2]) 
        easting = float(split_UTM[2][:-2])
    latlong = utm.to_latlon(easting,northing,zone_num,zone_let)
    return latlong
def string_transform ( utm_string , easting_northing = True ) : utm_strip = utm_string . strip ( ) split_UTM = utm_strip . split ( ) zone_num = float ( split_UTM [ 0 ] [ : 2 ] ) zone_let = str ( split_UTM [ 0 ] [ 2 : ] ) if easting_northing == True : easting = float ( split_UTM [ 1 ] [ : - 2 ] ) northing = float ( split_UTM [ 2 ] [ : - 2 ] ) elif easting_northing == False : northing = float ( split_UTM [ 1 ] [ : - 2 ] ) easting = float ( split_UTM [ 2 ] [ : - 2 ] ) latlong = utm . to_latlon ( easting , northing , zone_num , zone_let ) return latlong
Parse UTM coordinate string into a Latitude/Longitude Tuple
Parse UTM coordinate string into a Latitude / Longitude Tuple
"""Parse UTM coordinate string into a Latitude/Longitude Tuple
    
    Parameters
    ----------
    utm_string : str
        UTM coordinate string. Format as: "10M 551884.29mE 5278575.64mN"
    easting_northing : bool, optional
        Default=True. Set to False if UTM is formated with mN before mE.

    Returns
    -------
    tuple
        (Latitude, Longitude)
    """ #remove leading or trailing spaces
 #string split the UTM elements
 #turn the zone number into a number
 #turn the zone letter into its own letter
 #formated by convention
 #flipped the easting and northing
 #turn into latlon

None
tuple

utm_string
UTM coordinate string.
UTM coordinate string .
easting_northing
Default=True. Set to False if UTM is formated with mN before mE.
Default = True . Set to False if UTM is formated with mN before mE .