tiled.readers.excel.ExcelReader¶
- class tiled.readers.excel.ExcelReader(mapping, metadata=None, access_policy=None, authenticated_identity=None, entries_stale_after=None, metadata_stale_after=None, must_revalidate=True)[source]¶
Read the sheets in an Excel file.
This maps the Excel file, which may contain one of more spreadsheets, onto a “Tree” of tabular structures.
Examples
Given a file path
>>> ExcelReader.from_file("path/to/excel_file.xlsx")
Given a file object
>>> file = open("path/to/excel_file.xlsx") >>> ExcelReader.from_file(file)
Given a pandas.ExcelFile object
>>> import pandas >>> ef = pandas.ExcelFile(file) >>> ExcelReader.from_file(ef)
- __init__(mapping, metadata=None, access_policy=None, authenticated_identity=None, entries_stale_after=None, metadata_stale_after=None, must_revalidate=True)¶
Create a simple Tree from any mapping (e.g. dict, OneShotCachedMap).
- Parameters
- mappingdict-like
- metadatadict, optional
- access_policyAccessPolicy, optional
- authenticated_identitystr, optional
- entries_stale_after: timedelta
This server uses this to communite to the client how long it should rely on a local cache before checking back for changes.
- metadata_stale_after: timedelta
This server uses this to communite to the client how long it should rely on a local cache before checking back for changes.
- must_revalidatebool
Whether the client should strictly refresh stale cache items.
Methods
__init__(mapping[, metadata, access_policy, ...])Create a simple Tree from any mapping (e.g.
authenticated_as(identity)from_file(file)get(k[,d])items()keys()new_variation(*args[, mapping, metadata, ...])register_query(class_, translator)register_query_lazy(toplevel, register)Register a registration function which will be called if the toplevel module (e.g.
search(query)Return a Tree with a subset of the mapping.
values()Attributes
background_tasksentries_stale_afterinclude_routersmetadata_stale_afteraccess_policyauthenticated_identityentries_stale_atitems_indexerkeys_indexermetadataMetadata about this Tree.
metadata_stale_atmust_revalidatequery_registryvalues_indexer