to improve the docs of untar_data
untar_data
[source][test]
untar_data
(url
:str
,fname
:PathOrStr
=None
,dest
:PathOrStr
=None
,data
=True
,force_download
=False
) →Path
Download url
to fname
if it doesn’t exist, and un-tgz to folder dest
.
it
above in its semantic context refers to fname
, but according to the source code, it
should refer to dest
, because only when not dest.exist()
returns True
, download_data
will be executed
I would like to provide the following docs for untar_data
In general,
untar_data
use aurl
to download atgz
file underfname
, and then un-tgzfname
into a folder underdest
.
After initial download, if running
untar_data
again withforce_download=True
or the tgz file underfname
is corrupted somehow, then existingfname
anddest
will be removed and start to download again.
After initial downloading, if
dest
does not exist, meaning no folder underdest
exist (the folder could be removed or renamed somehow), then runninguntar_data
will executedownload_data
; and if the tgz file underfname
exist, then there will be no actual downloading rather than un-tgzfname
intodest
; iffname
does not exist, then downloading for the tgz file will be actually executed.
Note: the
url
you feed tountar_data
must be one ofURLs.something
.
What do you think of this version of docs? Thanks
@stas @sgugger