astropy 5.0

ParametersBackRef
import_file_to_cache(url_key, filename, remove_original=False, pkgname='astropy', *, replace=True)

The provided url_key will be the name used in the cache. The file should contain the contents of this URL, at least notionally (the URL may be temporarily or permanently unavailable). It is using url_key that users will request these contents from the cache. See download_file for details.

If url_key already exists in the cache, it will be updated to point to these imported contents, and its old contents will be deleted from the cache.

Parameters

url_key : str

The key to index the file under. This should probably be the URL where the file was located, though if you obtained it from a mirror you should use the URL of the primary location.

filename : str

The file whose contents you want to import.

remove_original : bool

Whether to remove the original file ( filename ) once import is complete.

pkgname : `str`, optional

The package name to use to locate the download cache. i.e. for pkgname='astropy' the default cache location is ~/.astropy/cache .

replace : boolean, optional

Whether or not to replace an existing object in the cache, if one exists. If replacement is not requested but the object exists, silently pass.

Import the on-disk file specified by filename to the cache.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

astropy.utils.data.export_download_cache astropy.utils.data.import_download_cache

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /astropy/utils/data.py#1901
type: <class 'function'>
Commit: