get_path_to_file¶
-
utilipy.data_utils.
get_path_to_file
(*data_name: str, package=None)[source]¶ Get path to file.
Similar to
get_pkg_data_filename()
, but only gets the path to the file, does not check if the file exists. The package directory must exist.- Parameters
- *data_nametuple of str
the path, without folder delimiters (which are platform specific) relative to
package
.One of the following:
The name of a directory included in the source distribution. The path is relative to the module calling this function. For example, if calling from
astropy.pkname
, use'data'
to get the files inastropy/pkgname/data
.Remote URLs are not currently supported.
- packagestr, optional
If specified, look for a file relative to the given package, rather than the default of looking relative to the calling module’s package.
- Returns
- filenamestr
A file path on the local file system corresponding to the data requested in
data_name
.