Module convert

Tools used in converting a pickled station database file to comma-separated value (.csv) file. These functions are used in most scripts bundled with this package.

stdb.convert.tocsv(stel=<class 'stdb.classes.StDbElement'>)

Subroutine to output an StDbElement to a csv formatted string


stel (StDbElement) – Instance of StDbElement to convert to .csv


csvstr – String representation of the csv content

Return type


stdb.convert.fromcsv(line='', lkey=False)

Subroutine to convert a csv format string into an StDbElement

  • line (str) – Line to read as csv

  • lkey (bool) – Parameter controlling the length of the key (with or without CHANNEL info)


  • key (str) – Key associated with each entry in database

  • entry (StDbElement) – Instance of StDbElement class