Python module for reading Survex data files.
Read one or more files by calling parseFile
for each file:
parser = SvxParser()
parser.parseFile("example.svx")
There are several Formatter
classes for writing the previously parsed data
to a new file, e.g. to a CSV file for import into Spelix:
with open("spelix.csv", "w") as handle:
parser.dump(SpelixCsvFormatter(handle))
After reading a file, the data table can be iterated over with iterdata
:
print("Total length:", sum(leg[Column.TAPE] for leg in parser.iterdata()))
Command line usage to convert to a supported format (to STDOUT):
python -m survexdata example.svx --spelix
BSD-2-Clause (c) Thomas Holder