Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds
.storage_options
and.protocol
toUPath
.The "non-pathlib" interface of
UPath
is then:UPath.protocol: str
the fsspec protocolUPath.storage_options: dict[str, Any]
the storage_options for the fsspec classUPath.path: str
the fsspec compatible path for use with the fsspec classUPath.fs: AbstractFileSystem
convenience attribute to access a instantiated fsspec classthe first three provide a public interface to access a file via fsspec as follows:
This closes #129, and closes #91.
additional changes:
.path
had to be overwritten to return a path that includes the bucket (consistent with fsspec).webdav+http
andwebdav+https
protocol workaround) the WebdavPath.protocol returns"webdav"
and thebase_url
is added to the.storage_options
. Which then allows to support the usecase from the code mentioned above again.HTTPPath().path
returns a full url, in line with fsspec behavior.extra note regarding local filesystems
Both
"file"
and""
returnLocalFileSystem
when usingfsspec.get_filesystem_class(protocol)
.