# Path: datapackage_pipelines/lib/dump/file_formats.py
# def identity(x):
# def json_dumps(x):
#     def prepare_resource(self, resource):
#     def __transform_row(self, row, fields):
#     def __transform_value(cls, value, field_type):
#     def write_row(self, writer, row, fields):
#     def prepare_resource(self, resource):
#     def initialize_file(self, file, headers):
#     def write_transformed_row(self, writer, transformed_row, fields):
#     def finalize_file(self, writer):
#     def prepare_resource(self, resource):
#     def initialize_file(self, file, headers):
#     def write_transformed_row(self, writer, transformed_row, fields):
#     def finalize_file(self, writer):
# class FileFormat():
# class CSVFormat(FileFormat):
# class JSONFormat(FileFormat):
#     SERIALIZERS = {
#         'array': json_dumps,
#         'object': json_dumps,
#         'datetime': lambda d: d.strftime(DATETIME_F_FORMAT),
#         'date': lambda d: d.strftime(DATE_F_FORMAT),
#         'time': lambda d: d.strftime(TIME_F_FORMAT),
#         'duration': lambda d: isodate.duration_isoformat(d),
#         'geopoint': lambda d: '{}, {}'.format(*d),
#         'geojson': json.dumps,
#         'year': lambda d: '{:04d}'.format(d),
#         'yearmonth': lambda d: '{:04d}-{:02d}'.format(*d),
#     }
#     DEFAULT_SERIALIZER = str
#     NULL_VALUE = ''
#     PYTHON_DIALECT = {
#         'number': {
#             'decimalChar': '.',
#             'groupChar': ''
#         },
#         'date': {
#             'format': DATE_P_FORMAT
#         },
#         'time': {
#             'format': TIME_P_FORMAT
#         },
#         'datetime': {
#             'format': DATETIME_P_FORMAT
#         },
#     }
#     SERIALIZERS = {
#         'datetime': lambda d: d.strftime(DATETIME_F_FORMAT),
#         'date': lambda d: d.strftime(DATE_F_FORMAT),
#         'time': lambda d: d.strftime(TIME_F_FORMAT),
#         'number': float,
#         'duration': lambda d: isodate.duration_isoformat(d),
#         'geopoint': lambda d: list(map(float, d)),
#         'yearmonth': lambda d: '{:04d}-{:02d}'.format(*d),
#     }
#     DEFAULT_SERIALIZER = identity
#     NULL_VALUE = None
#     PYTHON_DIALECT = {
#         'date': {
#             'format': DATE_P_FORMAT
#         },
#         'time': {
#             'format': TIME_P_FORMAT
#         },
#         'datetime': {
#             'format': DATETIME_P_FORMAT
#         },
#     }


from datapackage_pipelines.lib.dump.file_formats import CSVFormat, get_path
import os
import openpyxl


class XLSXFormat(CSVFormat):

    def prepare_resource(self, resource):
        super(XLSXFormat, self).prepare_resource(resource)

# Path: datapackage_pipelines/lib/dump/file_formats.py
# def identity(x):
# def json_dumps(x):
#     def prepare_resource(self, resource):
#     def __transform_row(self, row, fields):
#     def __transform_value(cls, value, field_type):
#     def write_row(self, writer, row, fields):
#     def prepare_resource(self, resource):
#     def initialize_file(self, file, headers):
#     def write_transformed_row(self, writer, transformed_row, fields):
#     def finalize_file(self, writer):
#     def prepare_resource(self, resource):
#     def initialize_file(self, file, headers):
#     def write_transformed_row(self, writer, transformed_row, fields):
#     def finalize_file(self, writer):
# class FileFormat():
# class CSVFormat(FileFormat):
# class JSONFormat(FileFormat):
#     SERIALIZERS = {
#         'array': json_dumps,
#         'object': json_dumps,
#         'datetime': lambda d: d.strftime(DATETIME_F_FORMAT),
#         'date': lambda d: d.strftime(DATE_F_FORMAT),
#         'time': lambda d: d.strftime(TIME_F_FORMAT),
#         'duration': lambda d: isodate.duration_isoformat(d),
#         'geopoint': lambda d: '{}, {}'.format(*d),
#         'geojson': json.dumps,
#         'year': lambda d: '{:04d}'.format(d),
#         'yearmonth': lambda d: '{:04d}-{:02d}'.format(*d),
#     }
#     DEFAULT_SERIALIZER = str
#     NULL_VALUE = ''
#     PYTHON_DIALECT = {
#         'number': {
#             'decimalChar': '.',
#             'groupChar': ''
#         },
#         'date': {
#             'format': DATE_P_FORMAT
#         },
#         'time': {
#             'format': TIME_P_FORMAT
#         },
#         'datetime': {
#             'format': DATETIME_P_FORMAT
#         },
#     }
#     SERIALIZERS = {
#         'datetime': lambda d: d.strftime(DATETIME_F_FORMAT),
#         'date': lambda d: d.strftime(DATE_F_FORMAT),
#         'time': lambda d: d.strftime(TIME_F_FORMAT),
#         'number': float,
#         'duration': lambda d: isodate.duration_isoformat(d),
#         'geopoint': lambda d: list(map(float, d)),
#         'yearmonth': lambda d: '{:04d}-{:02d}'.format(*d),
#     }
#     DEFAULT_SERIALIZER = identity
#     NULL_VALUE = None
#     PYTHON_DIALECT = {
#         'date': {
#             'format': DATE_P_FORMAT
#         },
#         'time': {
#             'format': TIME_P_FORMAT
#         },
#         'datetime': {
#             'format': DATETIME_P_FORMAT
#         },
#     }


# Path: tests/cli/custom_formatters/xlsx_format.py
from datapackage_pipelines.lib.dump.file_formats import CSVFormat, get_path
import os
import openpyxl



class XLSXFormat(CSVFormat):

    def prepare_resource(self, resource):
        super(XLSXFormat, self).prepare_resource(resource)

        basename, _ = os.path.splitext(get_path(resource))