def get_data(self): f = request.urlopen(self.url) info = f.info() if PY2: mime_type = info.type else: mime_type = info.get_content_type() file_type = FILE_TYPE_MIME_TABLE.get(mime_type, None) if file_type is None: file_type = get_file_type_from_url(self.url) content = f.read() sheets = get_data(content, file_type=file_type, **self.keywords) return sheets
def get_data(self): connection = request.urlopen(self.__url) info = connection.info() if PY2: mime_type = info.type else: mime_type = info.get_content_type() file_type = FILE_TYPE_MIME_TABLE.get(mime_type, None) if file_type is None: file_type = _get_file_type_from_url(self.__url) parser_library = self._keywords.get("parser_library", None) aparser = PARSER.get_a_plugin(file_type, parser_library) sheets = aparser.parse_file_stream(connection, **self._keywords) return sheets
def get_data(self): f = request.urlopen(self.__url) info = f.info() if PY2: mime_type = info.type else: mime_type = info.get_content_type() file_type = FILE_TYPE_MIME_TABLE.get(mime_type, None) if file_type is None: file_type = _get_file_type_from_url(self.__url) aparser = parser.get_a_plugin(file_type) content = f.read() sheets = aparser.parse_file_content(content, **self._keywords) return sheets
def get_data(self): connection = request.urlopen(self.__url) info = connection.info() if PY2: mime_type = info.type else: mime_type = info.get_content_type() file_type = FILE_TYPE_MIME_TABLE.get(mime_type, None) if file_type is None: file_type = _get_file_type_from_url(self.__url) parser_library = self._keywords.get('parser_library', None) aparser = PARSER.get_a_plugin(file_type, parser_library) sheets = aparser.parse_file_stream(connection, **self._keywords) return sheets