I/O

File I/O.

komoog.io.read_gpx(fn)[source]

Read a gpx file. Returns a gpxpy.GPX object. Pass to komoog.gpx.convert_gpx_tracks_to_arrays() as

gpx = read_gpx('Tour.gpx')
convert_gpx_tracks_to_arrays(gpx.tracks)

to retrieve distance and elevation profile.

komoog.io.read_tours()[source]

Read downloaded tours from ~/.komoog/tours.json

komoog.io.write_tours(tours)[source]

Write downloaded tours to ~/.komoog/tours.json

komoog.io.write_wav(fn, audio_data, sampling_rate)[source]

Write audio data to a wav file.