Folders
create_folder(workspace, display_name, *, parent_folder=None, df=True)
Create a new folder in the specified workspace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
str
|
The name or ID of the workspace where the folder will be created. |
required |
display_name
|
str
|
The name of the folder to create. |
required |
parent_folder
|
str
|
The name or ID of the parent folder. |
None
|
df
|
Optional[bool]
|
If True or not provided, returns a DataFrame with flattened keys. If False, returns a list of dictionaries. |
True
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, Dict[str, Any], None]
|
The created folder details if successful, otherwise None. |
Examples:
create_folder(
workspace_id='123e4567-e89b-12d3-a456-426614174000',
display_name='NewFolder',
parent_folder_id='456e7890-e12b-34d5-a678-90abcdef1234'
)
Source code in src/pyfabricops/core/folders.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
delete_folder(workspace, folder)
Delete a folder in a workspace
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
str
|
The name or ID of the workspace to delete the folder from. |
required |
folder
|
str
|
The name or ID of the folder to delete. |
required |
Returns:
| Type | Description |
|---|---|
None
|
None. |
Examples:
delete_folder(
workspace_id='123e4567-e89b-12d3-a456-426614174000',
folder_id='98f6b7c8-1234-5678-90ab-cdef12345678'
)
Source code in src/pyfabricops/core/folders.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
get_folder(workspace, folder, *, df=True)
Get a folder in a workspace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
str
|
The name or id of the workspace to get the folder from. |
required |
folder
|
str
|
The name or id of the folder to get. |
required |
df
|
Optional[bool]
|
If True or not provided, returns a DataFrame with flattened keys. If False, returns a list of dictionaries. |
True
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, Dict[str, Any], None]
|
The folder details if found, otherwise None. |
Examples:
get_folder(
workspace_id='123e4567-e89b-12d3-a456-426614174000',
folder_id='98f6b7c8-1234-5678-90ab-cdef12345678'
)
Source code in src/pyfabricops/core/folders.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
get_folder_id(workspace, folder_name)
Retrieves the ID of a folder by its name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder_name
|
str
|
The name of the folder. |
required |
Returns:
| Type | Description |
|---|---|
Union[str, None]
|
str | None: The ID of the folder if found, otherwise None. |
Source code in src/pyfabricops/core/folders.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
list_folders(workspace, *, df=True)
List folders in a workspace
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
str
|
The workspace to list folders from. |
required |
df
|
Optional[bool]
|
If True or not provided, returns a DataFrame with flattened keys. If False, returns a list of dictionaries. |
True
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, List[Dict[str, Any]], None]
|
A list of folders in the workspace. |
Examples:
list_folders('123e4567-e89b-12d3-a456-426614174000')
Source code in src/pyfabricops/core/folders.py
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 | |
move_folder(workspace, folder, *, target_folder=None, df=True)
Move a existing folder into other or root folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
str
|
The workspace where the folder will be updated. |
required |
folder
|
str
|
The folder to be moved. |
required |
target_folder
|
str
|
The name of the parent folder will receive the moved folder. |
None
|
df
|
bool
|
Keyword-only. If True or not provided, returns a DataFrame with flattened keys. If False, returns a list of dictionaries. |
True
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, Dict[str, Any], None]
|
The moved folder details if successful, otherwise None. |
Examples:
move_folder(
workspace_id='123e4567-e89b-12d3-a456-426614174000',
folder_id='414e7890-e12b-34d5-a678-90abcdef1234',
target_folder_id='9859b7c8-1234-5678-90ab-cdef12345678',
)
Source code in src/pyfabricops/core/folders.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
resolve_folder(workspace, folder)
Resolves a folder name to its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
str
|
The name or ID of the workspace. |
required |
folder
|
str
|
The name or ID of the folder. |
required |
Returns:
| Type | Description |
|---|---|
Union[str, None]
|
str | None: The ID of the folder if found, otherwise None. |
Source code in src/pyfabricops/core/folders.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
update_folder(workspace, folder, display_name, *, df=True)
Update a existing folder in the specified workspace.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
str
|
The name or id of the workspace where the folder will be updated. |
required |
folder
|
str
|
The name or id of the folder to update. |
required |
display_name
|
str
|
The name of the folder to update. |
required |
df
|
Optional[bool]
|
If True or not provided, returns a DataFrame with flattened keys. If False, returns a list of dictionaries. |
True
|
Returns:
| Type | Description |
|---|---|
Union[DataFrame, Dict[str, Any], None]
|
The updated folder details if successful, otherwise None. |
Examples:
update_folder(
workspace_id='123e4567-e89b-12d3-a456-426614174000',
folder_id='98f6b7c8-1234-5678-90ab-cdef12345678',
display_name='NewFolderName',
)
Source code in src/pyfabricops/core/folders.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |