download_external_example#

activitysim.examples.external.download_external_example(working_dir: Path, url: Optional[str] = None, cache_dir: Optional[Path] = None, cache_file_name: Optional[str] = None, sha256: Optional[str] = None, name=None, assets: Optional[dict] = None, link_assets: bool = True) Path#

Download an external example.

Parameters:
working_dirPath

The working directory where the external example files will be installed. The name subdirectory of this directory will be created if it does not exist, and downloaded files will be installed there.

urlstr, optional

The main url for the example to download. This should point to an archive file (e.g. blah.tar.gz) that will be unpacked into the target working subdirectory.

cache_dirPath, optional

The compressed archive(s) will be downloaded and cached in this directory. If not provided, a suitable cache location is chosen based on the suggested user cache locations from platformdirs library.

cache_file_namestr, optional

The archive at the primary url will be cached with this filename. It is typically not necessary to provide this file name explicitly, as a file name will be generated automatically from the url if not given.

sha256str, optional

This checksum is used to validate the download and/or the cached archive file. If the cached file exists but the checksum does not match, the file will be re-downloaded.

namestr, optional

The name of the external example. This will become the working subdirectory name where files are installed, unless the main archive has an embedded name (as a common prefix) in which case the name is ignored.

assetsdict, optional

Instructions for additional files to be downloaded to support this external example (e.g. large data files not in the main archive).

link_assetsbool, default True

If set to True, this function will attempt to symlink assets from the cache into the target directory instead of copying them. This can save disk space when the same external example is installed multiple times.

Returns:
Path

The working subdirectory name where files are installed.