5.3. Table Loader Factory Classes

5.3.1. File Loader Factory

class pytablereader.factory.TableFileLoaderFactory(source, encoding=None)[source]
Parameters:file_path (str) – Path to the loading file.
Raises:pytablereader.InvalidFilePathError – If the file_path is an empty path.
create_from_format_name(format_name)[source]

Create a file loader from a format name. Supported file formats are as follows:

Parameters:format_name (str) – Format name string (case insensitive).
Returns:Loader that coincides with the format_name:
Raises:pytablereader.LoaderNotFoundError – If an appropriate loader not found for the format.
create_from_path()[source]

Create a file loader from the file extension to loading file. Supported file extensions are as follows:

Extension Loader
"csv" CsvTableFileLoader
"xls"/"xlsx" ExcelTableFileLoader
"htm"/"html" HtmlTableFileLoader
"json" JsonTableFileLoader
"jsonl" JsonLinesTableFileLoader
"ldjson" JsonLinesTableFileLoader
"ltsv" LtsvTableFileLoader
"md" MarkdownTableFileLoader
"ndjson" JsonLinesTableFileLoader
"sqlite"/"sqlite3" SqliteFileLoader
"tsv" TsvTableFileLoader
Returns:Loader that coincides with the file extension of the file_extension.
Raises:pytablereader.LoaderNotFoundError – If an appropriate loader not found for loading the file.
file_extension

File extension of the source (without period). :rtype: str

Type:return
get_extension_list()
get_extensions()
Returns:Available format file extensions.
Return type:list
get_format_name_list()
get_format_names()
Returns:Available format names.
Return type:list
source

Data source to load. :rtype: str

Type:return

5.3.2. Url Loader Factory

class pytablereader.factory.TableUrlLoaderFactory(url, encoding=None, proxies=None)[source]
create_from_format_name(format_name)[source]

Create a file loader from a format name. Supported file formats are as follows:

Parameters:

format_name (str) – Format name string (case insensitive).

Returns:

Loader that coincide with the format_name:

Raises:
create_from_path()[source]

Create a file loader from the file extension to loading file. Supported file extensions are as follows:

Extension Loader
"csv" CsvTableTextLoader
"xls"/"xlsx" ExcelTableFileLoader
"htm"/"html"/"asp"/"aspx" HtmlTableTextLoader
"json" JsonTableTextLoader
"jsonl"/"ldjson"/"ndjson" JsonLinesTableTextLoader
"ltsv" LtsvTableTextLoader
"md" MarkdownTableTextLoader
"sqlite"/"sqlite3" SqliteFileLoader
"tsv" TsvTableTextLoader
Returns:

Loader that coincides with the file extension of the URL.

Raises:
get_extension_list()
get_extensions()
Returns:Available format file extensions.
Return type:list
get_format_name_list()
get_format_names()
Returns:Available format names.
Return type:list
source

Data source to load. :rtype: str

Type:return