graviti.file.base
#
Graviti basic file class.
Module Contents#
Classes#
This class represents the file in a DataFrame. |
|
This class represents local files. |
|
This class represents the file on Graviti platform. |
- class graviti.file.base.FileBase[source]#
Bases:
graviti.utility.repr.ReprMixin
This class represents the file in a DataFrame.
- property extension(self)[source]#
Get the extension of the file.
- Returns
The extension of the file.
- Return type
str
- property size(self)[source]#
Get the size of the file.
- Returns
The size of the file.
- Return type
int
- abstract open(self)[source]#
Return the binary file pointer of this file.
- Raises
NotImplementedError – The method of the base class should not be called.
- Return type
Union[graviti.utility.requests.UserResponse, _io.BufferedReader]
- class graviti.file.base.File(path)[source]#
Bases:
FileBase
This class represents local files.
- Parameters
path (str) – The local path of the file.
- property path(self)[source]#
Get the path of the file.
- Returns
The path of the file.
- Return type
pathlib.Path
- property extension(self)[source]#
Get the extension of the file.
- Returns
The extension of the file.
- Return type
str
- property size(self)[source]#
Get the size of the file.
- Returns
The size of the file.
- Return type
int
- class graviti.file.base.RemoteFile(key, extension, size, object_policy_manager)[source]#
Bases:
FileBase
This class represents the file on Graviti platform.
- Parameters
key (str) – The key of the file.
extension (str) – The extension of the file.
size (int) – The size of the file.
object_policy_manager (graviti.manager.ObjectPolicyManager) – The policy to access the file.