def parse_treasury_csv_column(column):
 column_re = re.compile('^(?P<prefix>RIFLGFC)(?P<unit>[YM])(?P<periods>[0-9]{2})(?P<suffix>_N.B)$')
 match = column_re.match(column)
 if (match is None):
  raise ValueError(("Couldn't parse CSV column %r." % column))
 (unit, periods) = get_unit_and_periods(match.groupdict())
 return (str(int(periods)) + ('year' if (unit == 'Y') else 'month'))

def parse_treasury_csv_column ( column ) : column_re = re . compile ( '^(?P<prefix>RIFLGFC)(?P<unit>[YM])(?P<periods>[0-9]{2})(?P<suffix>_N.B)$' ) match = column_re . match ( column ) if ( match is None ) : raise ValueError ( ( "Couldn't parse CSV column %r." % column ) ) ( unit , periods ) = get_unit_and_periods ( match . groupdict ( ) ) return ( str ( int ( periods ) ) + ( 'year' if ( unit == 'Y' ) else 'month' ) )
parse a treasury csv column into a more human-readable format .