How to use the pyexcel.source.AbstractSource.__init__ function in pyexcel

To help you get started, we’ve selected a few pyexcel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyexcel / pyexcel / pyexcel / plugins / sources / file_input.py View on Github external
def __init__(self, file_name=None, parser_library=None, **keywords):
        self.__file_name = file_name

        if "force_file_type" in keywords:
            file_type = keywords.get("force_file_type")
        else:
            file_type = self.__file_name.split(".")[-1]
        self.__parser = PARSER.get_a_plugin(file_type, parser_library)
        AbstractSource.__init__(self, **keywords)
github pyexcel / pyexcel / pyexcel / plugins / sources / sheet_stream_source.py View on Github external
def __init__(self, sheet_stream, **keywords):
        self.__sheet_stream = sheet_stream
        AbstractSource.__init__(self, **keywords)
github pyexcel / pyexcel / pyexcel / plugins / sources / pydata / dictsource.py View on Github external
def __init__(
        self, adict, with_keys=True, sheet_name=DEFAULT_SHEET_NAME, **keywords
    ):
        self.__adict = adict
        self.__with_keys = with_keys
        self._content = _FakeIO()
        self.__sheet_name = sheet_name
        AbstractSource.__init__(self, **keywords)
github pyexcel / pyexcel / pyexcel / plugins / sources / memory_input.py View on Github external
def __init__(
        self,
        file_content=None,
        file_type=None,
        file_stream=None,
        parser_library=None,
        **keywords
    ):
        self.__file_type = file_type
        self.__file_stream = file_stream
        self.__file_content = file_content
        self.__parser = PARSER.get_a_plugin(file_type, parser_library)
        AbstractSource.__init__(self, **keywords)
github pyexcel / pyexcel / pyexcel / plugins / sources / file_output.py View on Github external
def __init__(self, file_name=None, renderer_library=None, **keywords):
        AbstractSource.__init__(self, **keywords)
        self._file_name = file_name

        if "force_file_type" in keywords:
            file_type = keywords.get("force_file_type")
        else:
            file_type = find_file_type_from_file_name(file_name, "write")

        self._renderer = RENDERER.get_a_plugin(file_type, renderer_library)
github pyexcel / pyexcel / pyexcel / plugins / sources / pydata / arraysource.py View on Github external
def __init__(self, array, sheet_name=DEFAULT_SHEET_NAME, **keywords):
        self.__array = array
        self._content = _FakeIO()
        self.__sheet_name = sheet_name
        AbstractSource.__init__(self, **keywords)
github pyexcel / pyexcel / pyexcel / plugins / sources / pydata / records.py View on Github external
def __init__(self, records, sheet_name=DEFAULT_SHEET_NAME, **keywords):
        self.__records = records
        self._content = _FakeIO()
        self.__sheet_name = sheet_name
        AbstractSource.__init__(self, **keywords)
github pyexcel / pyexcel / pyexcel / plugins / sources / db_sources.py View on Github external
def __init__(
        self, db_type, parser_library=None, renderer_library=None, **keywords
    ):
        self.__db_type = db_type
        self.__parser_library = parser_library
        self.__renderer_library = renderer_library
        AbstractSource.__init__(self, **keywords)
github pyexcel / pyexcel / pyexcel / plugins / sources / output_to_memory.py View on Github external
def __init__(
        self,
        file_type=None,
        file_stream=None,
        renderer_library=None,
        **keywords
    ):
        AbstractSource.__init__(self, **keywords)

        self._renderer = RENDERER.get_a_plugin(file_type, renderer_library)
        if file_stream:
            self._content = file_stream
        else:
            self._content = self._renderer.get_io()
        self.attributes = RENDERER.get_all_file_types()