graviti.utility.file
#
Graviti file related class.
Module Contents#
Classes#
This class represents the file in a DataFrame. |
|
This class represents the file on Graviti platform. |
|
This class represents the local file. |
- class graviti.utility.file.FileBase[source]#
Bases:
graviti.utility.repr.ReprMixin
This class represents the file in a DataFrame.
- 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]
- property checksum(self)[source]#
Get the checksum of the file.
- Returns
The checksum of the file.
- Return type
str
- static from_pyarrow(scalar)[source]#
Create File or RemoteFile instance with pyarrow struct scalar.
- Parameters
scalar (pyarrow.StructScalar) – The input pyarrow struct scalar.
- Returns
The File or RemoteFile instance.
- Return type
Union[RemoteFile, File]
- class graviti.utility.file.RemoteFile(url, checksum)[source]#
Bases:
FileBase
This class represents the file on Graviti platform.
- Parameters
url (str) – The url string of the file.
checksum (str) – The checksum of the file.
- open(self)[source]#
Return the binary file pointer of this file.
- Returns
The remote file pointer.
- Return type
Union[graviti.utility.requests.UserResponse, _io.BufferedReader]
- class graviti.utility.file.File(path)[source]#
Bases:
FileBase
This class represents the local file.
- Parameters
path (str) – The local path of the file.
- property checksum(self)[source]#
Get the sha1 checksum of the local file.
- Returns
The sha1 checksum of the local file.
- Return type
str