class Track(object):

    def __init__(self, recordDelay=10, maxSize=3600, ignoreDuplicates=True,
        duplicateRange=0.0001):
        """ Constructor
        The default values allow for 10 hours worth of data recorded
        at 10 second intervals.
        recordDelay - Delay between recording data points
        maxSize - Maximum number of points to record
        ignoreDuplicates - Ignore entries that are very similar (ie moved a minimal distance)
        duplicateRange - Varience range within a duplicate is detected (adjust to account for
            subtle gps position drift)
        """
self.recordDelay = recordDelay
self.maxSize = maxSize
self.ignoreDuplicates = ignoreDuplicates
self.duplicateRange = duplicateRange
self.positions = []
self.latest = None

def append(self, position, heading, timeStamp=None):
    """ Append position and heading information """
if timeStamp is None:
    timeStamp = datetime.utcnow()
self.latest = timeStamp, position, heading
if len(self.positions):
    last = self.positions[0]
else:
    last = None
if last is None or (timeStamp - last[0]).seconds >= self.recordDelay:
    self.positions.insert(0, self.latest)
self.latest = None
if len(self.positions) > self.maxSize:
    pass

def clear(self):
    """ Clear all items from track """
self.positions = []
self.latest = None

def __len__(self):
    """ Return the length of the track """
if self.latest is None:
    return len(self.positions)
return len(self.positions) + 1

def __getslice__(self, i, j):
    return self.positions[i:j]

def __getitem__(self, i):
    return self.positions[i]

def get_latest(self):
    if self.latest is None and len(self.positions) > 0:
        return self.positions

def get_by_time(self, timeRange, now=datetime.utcnow()):
    """ Returns the last n items within the time range """
result = []
if self.latest is not None:
    result.append(self.latest)
for position in self.positions:
    if (now - position[0]).seconds > timeRange:
        break
result.append(position)
return result
Is there any GPS library for use in Python?