open
Asynchronously open a file and return an async context manager. This function checks if the underlying filesystem supports obstore bypass. If it does, it uses obstore to open the file. Otherwise, it falls back to the standard _open function which uses AsyncFileSystem.
def open(
path: str,
mode: str = "rb",
kwargs: Any
) - > AsyncReadableFile | AsyncWritableFile
Asynchronously open a file and return an async context manager. This function checks if the underlying filesystem supports obstore bypass. If it does, it uses obstore to open the file. Otherwise, it falls back to the standard _open function which uses AsyncFileSystem. It will raise NotImplementedError if neither obstore nor AsyncFileSystem is supported.
Parameters
| Name | Type | Description |
|---|---|---|
| path | str | The file path to open. This path is used to determine the underlying filesystem. |
| mode | str = "rb" | The mode in which to open the file (e.g., 'rb' for read binary, 'wb' for write binary). This determines whether the returned file object is readable or writable. |
| kwargs | Any | Additional keyword arguments to pass to the underlying file opening mechanism, such as obstore bypass or AsyncFileSystem. |
Returns
| Type | Description |
|---|---|
| `AsyncReadableFile | AsyncWritableFile` |