ensure_excel
- ensure_excel(key, *subkeys, url, name=None, force=False, download_kwargs=None, read_excel_kwargs=None)[source]
Download an excel file and open as a dataframe with
pandas
.- Parameters:
key (
str
) – The module namesubkeys (
str
) – A sequence of additional strings to join. If none are given, returns the directory for this module.url (
str
) – The URL to download.name (
Optional
[str
]) – Overrides the name of the file at the end of the URL, if given. Also useful for URLs that don’t have proper filenames with extensions.force (
bool
) – Should the download be done again, even if the path already exists? Defaults to false.download_kwargs (
Optional
[Mapping
[str
,Any
]]) – Keyword arguments to pass through topystow.utils.download()
.read_excel_kwargs (
Optional
[Mapping
[str
,Any
]]) – Keyword arguments to pass through topandas.read_excel()
.
- Return type:
- Returns:
A pandas DataFrame