Api reference¶
mondaytoframe.create_board(column_types, monday_token, board_name='Created by mondaytoframe', board_kind=BoardKind.public, workspace_id=None)
¶
Source code in src/mondaytoframe/io.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 | |
mondaytoframe.create_items(board_id, df, monday_token, unknown_type='raise')
¶
Creates items on a Monday.com board based on the provided dataframe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
board_id
|
str
|
The ID of the Monday.com board where items will be created. |
required |
df
|
DataFrame
|
A pandas DataFrame containing the data for the items to be created. The DataFrame must include a 'Name' column, and it must not contain null values. |
required |
monday_token
|
TokenType
|
The authentication token for accessing the Monday.com API. |
required |
unknown_type
|
Literal['drop', 'raise']
|
Specifies how to handle unknown columns in the DataFrame that do not match the board schema. Defaults to "raise". - "drop": Drops unknown columns. - "raise": Raises an error if unknown columns are found. |
'raise'
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the DataFrame is empty, does not contain a 'Name' column, or if the 'Name' column contains null values. |
Notes
- The function aligns the DataFrame with the board schema before creating items.
- Each row in the DataFrame corresponds to an item on the board.
- The 'name' and 'group' columns in the DataFrame are used for item names and group IDs, respectively. Other columns are treated as column values for the items.
Source code in src/mondaytoframe/io.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 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 | |
mondaytoframe.read(board_id, monday_token, unknown_type='text', **kwargs)
¶
Read data from a Monday.com board into a pandas DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
board_id
|
str
|
The ID of the Monday.com board to read data from. |
required |
monday_token
|
TokenType
|
The authentication token for Monday.com API. |
required |
unknown_type
|
Literal['text', 'drop', 'raise']
|
Specifies how to handle unknown column types. - "text": Use a default text parser for unknown column types (default). - "drop": Ignore unknown column types. - "raise": Raise a ValueError if unknown column types are found. |
'text'
|
**kwargs
|
dict[str, Any]
|
Additional arguments to pass to the Monday.com API. |
{}
|
Returns:
| Type | Description |
|---|---|
|
pd.DataFrame: A pandas DataFrame containing the board data. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If unknown column types are found and |
Notes
The function uses predefined parsers for known column types. If a column type is not recognized and unknown_type
is set to "text", a default text parser will be used. If unknown_type is set to "drop", the unknown columns will
be ignored.
Usage:
from mondaytoframe import read
df = read(board_id="123456", monday_token="your_token")
print(df.head())
Source code in src/mondaytoframe/io.py
103 104 105 106 107 108 109 110 111 112 113 114 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 157 158 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 187 188 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 | |
mondaytoframe.update(board_id, df, monday_token, unknown_type='raise', **kwargs)
¶
Update a pandas DataFrame to a Monday.com board.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
board_id
|
str
|
The ID of the Monday.com board. |
required |
df
|
DataFrame
|
The DataFrame to update to the board. |
required |
monday_token
|
TokenType
|
The authentication token for Monday.com. |
required |
unknown_type
|
Literal['drop', 'raise']
|
Specifies how to handle columns in the DataFrame that do not have a corresponding parser in the board schema. - "drop": Ignore columns that do not have a corresponding parser (default). - "raise": Raise a ValueError if columns do not have a corresponding parser. |
'raise'
|
**kwargs
|
Any
|
Additional keyword arguments to pass to the Monday.com API. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If unknown_type is "raise" and there are columns in the DataFrame that do not have a corresponding parser in the board schema. |
Usage:
from mondaytoframe import update
import pandas as pd
df = pd.DataFrame({
"Name": ["Task 1", "Task 2"],
"Status": ["Done", "In Progress"],
"Tags": [["tag1"], ["tag2", "tag3"]],
})
update(board_id="123456", df=df, monday_token="your_token")
Source code in src/mondaytoframe/io.py
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | |
mondaytoframe.delete_board(board_id, monday_token)
¶
Delete a board in Monday.com.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
board_id
|
str
|
The ID of the board to delete. |
required |
monday_token
|
TokenType
|
The authentication token for Monday.com. |
required |
Usage:
from mondaytoframe import delete_board
delete_board(board_id="123456", monday_token="your_token")
Source code in src/mondaytoframe/io.py
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | |