(self)
return '\n\n'.join(return_strings)
Export the story as a markdown.
Export the story as a markdown.
Export the story as a markdown .
def export_story(self):
        """Export the story as a markdown."""
        return_strings = []
        for line_dict in self._data_lines:
            line_type = line_dict.get('type', '')
            if line_type == 'text':
                return_strings.append(line_dict.get('value', ''))

            elif line_type == 'aggregation':
                aggregation_data = line_dict.get('value')
                aggregation = aggregation_data.get('aggregation')
                if not aggregation:
                    return_strings.append(
                        '**Unable to fetch aggregation data**')
                    continue
                return_strings.append(
                    self._dataframe_to_markdown(aggregation.to_pandas()))

            elif line_type == 'dataframe':
                return_strings.append(
                    self._dataframe_to_markdown(line_dict.get('value')))

            elif line_type == 'chart':
                return_strings.append(
                    '*<unable_to_display_chart_objects>*')

        return '\n\n'.join(return_strings)
def export_story ( self ) : return_strings = [ ] for line_dict in self . _data_lines : line_type = line_dict . get ( 'type' , '' ) if line_type == 'text' : return_strings . append ( line_dict . get ( 'value' , '' ) ) elif line_type == 'aggregation' : aggregation_data = line_dict . get ( 'value' ) aggregation = aggregation_data . get ( 'aggregation' ) if not aggregation : return_strings . append ( '**Unable to fetch aggregation data**' ) continue return_strings . append ( self . _dataframe_to_markdown ( aggregation . to_pandas ( ) ) ) elif line_type == 'dataframe' : return_strings . append ( self . _dataframe_to_markdown ( line_dict . get ( 'value' ) ) ) elif line_type == 'chart' : return_strings . append ( '*<unable_to_display_chart_objects>*' ) return '\n\n' . join ( return_strings )