File
File
Bases: BaseClass
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
id of the file |
name |
str
|
name of the file including the extension |
Source code in furthrmind\collection\file.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
delete(id='', project_id='')
classmethod
Method to delete an item. Can be called as a classmethod with providing the id to be deleted or on the instance of a class
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
str
|
The id of the resource to delete |
''
|
project_id |
str
|
Optionally to delete an item in another project as the furthrmind sdk was initiated with |
''
|
Returns:
Type | Description |
---|---|
str
|
The id of the item |
Source code in furthrmind\collection\baseclass.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
|
download(folder, overwrite=False)
Method to download a file
Parameters:
Name | Type | Description | Default |
---|---|---|---|
folder |
str
|
The folder where the file should be saved |
required |
overwrite |
bool
|
Whether to overwrite the existing file in the folder if it already exists (default is False) |
False
|
Source code in furthrmind\collection\file.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
download_bytes()
Method to download a file and save to BytesIO object
Returns: BytesIO: The downloaded file stored as BytesIO object
Source code in furthrmind\collection\file.py
51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
to_dict()
Converts the object's attributes to a dictionary representation.
Returns:
Type | Description |
---|---|
dict
|
Dictionary containing the object's attributes (excluding private attributes, callable attributes, and attributes of type Furthrmind). |
Source code in furthrmind\collection\baseclass.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 |
|
update_file(file_path, file_name='')
Update a file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
str
|
The path to the file. |
required |
file_name |
str
|
The new file name. Defaults to "". If not set, the file_name is taken from the file_path. |
''
|
Raises:
Type | Description |
---|---|
ValueError
|
If the file does not exist. |
Source code in furthrmind\collection\file.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|