Archive Urls

Archive Urls represent an archive file in the local file system, such as a Zip file. They provide implementations of Url.get_target() that will extract the target file from the archive and store it in the file cache, returning a new Url to the extracted file.

class rowgenerators.appurl.archive.ZipUrl(url=None, downloader=None, **kwargs)[source]

Zip URLS represent a zip file, as a local resource.

static get_file_from_zip(url)[source]

Given a file name that may be a regular expression, return the full name for the file from a zip archive

get_resource()[source]

Return a url to the resource, which for FileUrls is always self.

get_target()[source]

Extract the target file from the archive, store it in the cache, and return a file Url to the cached file.

join_target(tf)[source]

Joins the target tf by setting the value of the first slot of the fragment.

Parameters:tf
Returns:a clone of this url with a new fragment.
list()[source]

List the files in the referenced Zip file

static real_files_in_zf(zf)[source]

Return a list of internal paths of real files in a zip file, based on the ‘external_attr’ values

target_file

Returns the target file, which is usually stored in the first slot in the fragment, but may have been overridden with a fragment_query.

Returns:
zip_dir

Directory that files will be extracted to