paths
AsyncRemotePath
RemotePath is used to model a remote path, it takes inspiration from pathlib
and shares some of its interface.
date: Optional[str] = Field(None, title='Date')
class-attribute
instance-attribute
group: Optional[str] = Field(None, title='Group')
class-attribute
instance-attribute
hardlinks: Optional[int] = Field(0, title='Hardlinks')
class-attribute
instance-attribute
name: Optional[str] = Field(None, title='Name')
class-attribute
instance-attribute
perms: Optional[str] = Field(None, title='Perms')
class-attribute
instance-attribute
size: Optional[float] = Field(0, title='Size')
class-attribute
instance-attribute
user: Optional[str] = Field(None, title='User')
class-attribute
instance-attribute
RemotePath is used to model a remote path, it takes inspiration from pathlib and shares some of its interface.
Source code in sfapi_client/_async/paths.py
compute: Optional[AsyncCompute]
instance-attribute
date: Optional[str] = Field(None, title='Date')
class-attribute
instance-attribute
group: Optional[str] = Field(None, title='Group')
class-attribute
instance-attribute
hardlinks: Optional[int] = Field(0, title='Hardlinks')
class-attribute
instance-attribute
name = self._path.name
instance-attribute
parent: RemotePath
property
The parent of the path.
Returns:
Type | Description |
---|---|
RemotePath
|
the parent |
parents: List[RemotePath]
property
parts: Tuple[str]
property
perms: Optional[str] = Field(None, title='Perms')
class-attribute
instance-attribute
size: Optional[float] = Field(0, title='Size')
class-attribute
instance-attribute
stem: str
property
suffix: str
property
suffixes: List[str]
property
user: Optional[str] = Field(None, title='User')
class-attribute
instance-attribute
dict(*args, **kwargs)
download(binary=False)
async
Download the file contents.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
binary
|
indicate if the file should be treated as binary, defaults to False |
False
|
Raises:
Type | Description |
---|---|
IsADirectoryError
|
if path points to a directory. |
SfApiError
|
|
Source code in sfapi_client/_async/paths.py
is_dir()
async
Returns:
Type | Description |
---|---|
bool
|
Returns True if path is a directory, False otherwise. |
is_file()
async
ls()
async
open(mode)
async
Open the file at this path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
The mode to open the file. Valid options are 'rwb'. raises: IsDirectoryError: If the path is not a file. |
required |
Source code in sfapi_client/_async/paths.py
update()
async
Update the path in the latest information from the resource.