newton.utils.download_asset#
- newton.utils.download_asset(asset_folder, cache_dir=None, force_refresh=False)[source]#
Downloads a specific folder from the newton-assets GitHub repository into a local cache.
- Parameters:
asset_folder (str) – The folder within the repository to download (e.g., “assets/models”)
cache_dir (str | None) – Directory to cache downloads. If
None, the path is determined in the following order: 1.NEWTON_CACHE_PATHenvironment variable. 2. System’s user cache directory (viaappdirs.user_cache_dir).force_refresh (bool) – If True, re-downloads even if cached version exists
- Returns:
Path to the downloaded folder in the local cache
- Return type: