def to_json(self):
        """Return a header as a dictionary."""
        a_per = self.analysis_period.to_json() if self.analysis_period else None
        return {'data_type': self.data_type.to_json(),
                'unit': self.unit,
                'analysis_period': a_per,
                'metadata': self.metadata}
def to_json ( self ) : a_per = self . analysis_period . to_json ( ) if self . analysis_period else None return { 'data_type' : self . data_type . to_json ( ) , 'unit' : self . unit , 'analysis_period' : a_per , 'metadata' : self . metadata }
Return a header as a dictionary.