Test if path exists prepending Repository base URL to path. Test if `path` exists as (and in this order): - a local file. - a remote URL that has been downloaded and stored locally in the `DataSource` directory. - a remote URL that has not been do
(self, path)
| 614 | return DataSource.abspath(self, self._fullpath(path)) |
| 615 | |
| 616 | def exists(self, path): |
| 617 | """ |
| 618 | Test if path exists prepending Repository base URL to path. |
| 619 | |
| 620 | Test if `path` exists as (and in this order): |
| 621 | |
| 622 | - a local file. |
| 623 | - a remote URL that has been downloaded and stored locally in the |
| 624 | `DataSource` directory. |
| 625 | - a remote URL that has not been downloaded, but is valid and |
| 626 | accessible. |
| 627 | |
| 628 | Parameters |
| 629 | ---------- |
| 630 | path : str or pathlib.Path |
| 631 | Can be a local file or a remote URL. This may, but does not |
| 632 | have to, include the `baseurl` with which the `Repository` was |
| 633 | initialized. |
| 634 | |
| 635 | Returns |
| 636 | ------- |
| 637 | out : bool |
| 638 | True if `path` exists. |
| 639 | |
| 640 | Notes |
| 641 | ----- |
| 642 | When `path` is a URL, `exists` will return True if it's either |
| 643 | stored locally in the `DataSource` directory, or is a valid remote |
| 644 | URL. `DataSource` does not discriminate between the two, the file |
| 645 | is accessible if it exists in either location. |
| 646 | |
| 647 | """ |
| 648 | return DataSource.exists(self, self._fullpath(path)) |
| 649 | |
| 650 | def open(self, path, mode='r', encoding=None, newline=None): |
| 651 | """ |