Coretex
|
Public Member Functions | |
Optional[Self] | createCustomSample (cls, str name, int datasetId, Union[Path, str] filePath, Optional[str] mimeType=None) |
Public Member Functions inherited from coretex.coretex.sample.network_sample.NetworkSample | |
str | path (self) |
str | zipPath (self) |
bool | download (self, bool ignoreCache=False) |
Public Member Functions inherited from coretex.coretex.sample.sample.Sample | |
None | unzip (self, bool ignoreCache=False) |
Path | joinPath (self, Union[Path, str] other) |
Public Member Functions inherited from coretex.coretex.sample.custom_sample.local_custom_sample.LocalCustomSample | |
CustomSampleData | load (self) |
Public Member Functions inherited from coretex.coretex.sample.local_sample.LocalSample | |
str | path (self) |
str | zipPath (self) |
bool | download (self, bool ignoreCache=False) |
Represents the custom Sample object from Coretex.ai\n Custom samples are used when working with Other Task\n Custom sample must be an archive
Definition at line 28 of file custom_sample.py.
Optional[Self] coretex.coretex.sample.custom_sample.custom_sample.CustomSample.createCustomSample | ( | cls, | |
str | name, | ||
int | datasetId, | ||
Union[Path, str] | filePath, | ||
Optional[str] | mimeType = None |
||
) |
Creates a new custom sample with specified properties\n For creating custom sample, sample must be an archive Parameters ---------- name : str sample name datasetId : int id of dataset to which the sample will be added filePath : str path to the sample mimeType : Optional[str] mime type of the file, if None mime type guessing will be performed Returns ------- Optional[Self] -> The created sample object or None if creation failed Raises ------ NetworkRequestError, ValueError -> if some kind of error happened during the upload of the provided file Example ------- >>> from coretex import CustomSample \b >>> sample = CustomSample.createCustomSample("name", 1023, "path/to/file") >>> if sample is None: print("Failed to create custom sample")
Definition at line 40 of file custom_sample.py.