Async operator
The entry class for all public async APIs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scheme
|
str
|
The service name that OpenDAL supports. |
required |
**options
|
any
|
The options for the service. See the documentation of each service for more details. |
{}
|
Example
1 2 3 4 |
|
copy(source, target)
async
#
Copy the object from source to target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source
|
str | Path
|
The source path. |
required |
target
|
str | Path
|
The target path. |
required |
create_dir(path)
async
#
Create a directory at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the directory. |
required |
delete(path)
async
#
Delete the object at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the object. |
required |
exists(path)
async
#
Check if the object at the given path exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the object. |
required |
Returns#
1 |
|
list(path, **kwargs)
async
#
List objects at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the directory/ prefix. |
required |
**kwargs
|
Any
|
Optional listing parameters matching the
OpenDAL
|
{}
|
Returns#
1 2 |
|
open(path, mode, **options)
async
#
Open a file at the given path for reading or writing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the file. |
required |
mode
|
str
|
The mode to open the file. Must be either |
required |
**options
|
Any
|
Additional options passed to the underlying OpenDAL reader
or writer.
- If |
{}
|
Returns#
1 |
|
Example
1 2 3 4 5 |
|
presign_delete(path, expire_second)
async
#
Generate a presigned URL for delete operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the object. |
required |
expire_second
|
int
|
The expiration time in seconds. |
required |
Returns#
1 |
|
presign_read(path, expire_second)
async
#
Generate a presigned URL for read operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the object. |
required |
expire_second
|
int
|
The expiration time in seconds. |
required |
Returns#
1 |
|
presign_stat(path, expire_second)
async
#
Generate a presigned URL for stat operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the object. |
required |
expire_second
|
int
|
The expiration time in seconds. |
required |
Returns#
1 |
|
presign_write(path, expire_second)
async
#
Generate a presigned URL for write operation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the object. |
required |
expire_second
|
int
|
The expiration time in seconds. |
required |
Returns#
1 |
|
read(path, **options)
async
#
Read the content of the object at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the object. |
required |
**options
|
Any
|
Optional read parameters matching the
OpenDAL
|
{}
|
Returns#
1 |
|
remove_all(path)
async
#
Remove all objects at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the directory. |
required |
rename(source, target)
async
#
Rename the object from source to target.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source
|
str | Path
|
The source path. |
required |
target
|
str | Path
|
The target path. |
required |
scan(path, **kwargs)
async
#
Scan the objects at the given path recursively.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the directory/ prefix. |
required |
**kwargs
|
Any
|
Optional listing parameters matching the
OpenDAL |
{}
|
Returns#
1 2 3 4 |
|
stat(path, **kwargs)
async
#
Get the metadata of the object at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the object. |
required |
**kwargs
|
Any
|
Optional stat parameters matching the
OpenDAL
|
{}
|
Returns#
1 |
|
write(path, bs, **options)
async
#
Write the content to the object at the given path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str | Path
|
The path to the object. |
required |
bs
|
bytes
|
The content to write. |
required |
**options
|
Any
|
Optional write parameters matching the
OpenDAL
|
{}
|
Returns#
1 |
|