scopesim.server.database.download_packages

scopesim.server.database.download_packages#

scopesim.server.database.download_packages(pkg_names: Iterable[str] | str, release: str = 'stable', save_dir: Path | str | None = None) list[Path]#

Download one or more packages to the local disk.

The downloaded version may be specified as stable, latest (dev) or fixed to a specific release.

Changed in version 0.11.0: Downloading from the GitHub repository is deprecated and will be removed in a future version. If you need to use an unreleased dev version, please clone the IRDB repo instead and link your local clone using sim.link_irdb().

Parameters:
  • pkg_names (str, list) – A list of package names, see list_packages()

  • release (str, optional) – By default, the most recent stable version of a package is downloaded. Other options are: - “stable” : the most recent stable version - “latest” : the latest development version to be published - a specific package filename as given by list_packages (see examples)

  • save_dir (str, optional) – The place on the local disk where the .zip package is to be saved. If left as None, defaults to the value in scopesim.rc.__config__[“!SIM.file.local_packages_path”]

  • from_cache (bool, optional) – Use the cached versions of the packages. If None, defaults to the RC value: !SIM.file.use_cached_downloads

Returns:

save_path – The absolute path to the saved .zip package

Return type:

str

Examples

::

from scopesim import download_packages, list_packages

# Stable release of a list of packages download_packages([“test_package”, “test_package”])

# Development release of a single package download_packages(“test_package”, release=”latest”)

# Specific version of the package list_packages(“test_package”) download_packages(“test_package”, release=”2022-04-09.dev”)