pyOnlineSpreadSheetEditing API Documentation
editconfig
Created on 2021-12-31
@author: wf
EditConfig
Edit and Query Configuration.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the configuration. |
sourceWikiId |
Optional[str]
|
The source Wiki ID. |
targetWikiId |
Optional[str]
|
The target Wiki ID. |
queries |
Dict[str, str]
|
The queries dictionary. |
format |
Optional[str]
|
The format of the output. |
Source code in onlinespreadsheet/editconfig.py
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 |
|
toTableQuery()
convert me to a TableQuery
Returns:
Name | Type | Description |
---|---|---|
TableQuery |
TableQuery
|
the table query for my queries |
Source code in onlinespreadsheet/editconfig.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
EditConfigs
manager for edit configurations
Source code in onlinespreadsheet/editconfig.py
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 89 90 91 92 93 94 95 96 |
|
add(editConfig)
add a editConfiguration
Source code in onlinespreadsheet/editconfig.py
79 80 81 82 83 |
|
gsimport
Created on 2024-03-18
@author: wf
GsImportSolution
Bases: InputWebSolution
the google spreadsheet import solution
Source code in onlinespreadsheet/gsimport.py
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 |
|
__init__(webserver, client)
Initialize the solution
Calls the constructor of the base solution Args: webserver (GsImportWebserver): The webserver instance associated with this context. client (Client): The client instance this context is associated with.
Source code in onlinespreadsheet/gsimport.py
50 51 52 53 54 55 56 57 58 59 |
|
home()
async
Generates the home page with a selection of examples and svg display
Source code in onlinespreadsheet/gsimport.py
69 70 71 72 73 74 75 |
|
show_ui()
show my user interface
Source code in onlinespreadsheet/gsimport.py
63 64 65 66 67 |
|
GsImportWebserver
Bases: InputWebserver
Google Spreadsheet Import and Wikidata Sync
Source code in onlinespreadsheet/gsimport.py
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 |
|
__init__()
Constructs all the necessary attributes for the WebServer object.
Source code in onlinespreadsheet/gsimport.py
36 37 38 39 40 41 42 |
|
gsimport_cmd
Created on 2024-03-18
@author: wf
GoogleSheetWikidataCmd
Bases: WebserverCmd
Command line tool for managing Google Sheets to Wikidata imports via a web server.
Source code in onlinespreadsheet/gsimport_cmd.py
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 |
|
getArgParser(description, version_msg)
Extend the default argument parser with Google Sheets to Wikidata specific arguments.
Source code in onlinespreadsheet/gsimport_cmd.py
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 |
|
main(argv=None)
Main entry point for the command-line tool.
Source code in onlinespreadsheet/gsimport_cmd.py
66 67 68 69 70 71 72 73 74 75 |
|
profile
Profile
Bases: JSONAble
Generates a profile page from a given wikidata id
Source code in onlinespreadsheet/profile.py
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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 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 |
|
getIdIcon(idType)
Returns a url to the icon of the given id
Source code in onlinespreadsheet/profile.py
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 |
|
getIdentifiers()
Retrieves all identifiers of the user that are assigned to the id
Returns:
Type | Description |
---|---|
dict
|
dict of dict containing the id, idUrl, type of id |
Source code in onlinespreadsheet/profile.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
getUserIdentifierQuery()
Returns the query for the Identifiers of given human
Source code in onlinespreadsheet/profile.py
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 |
|
getUserInformation()
Retrieves basic information about the user from wikidata that is assigned to the id
Source code in onlinespreadsheet/profile.py
92 93 94 95 96 97 98 99 |
|
getUserInformationQuery()
Returns the query for basic user information
Source code in onlinespreadsheet/profile.py
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 |
|
ProfileBlueprint
Bases: object
Flask Blueprint providing routes to the profile pages
Source code in onlinespreadsheet/profile.py
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 |
|
__init__(app, name, template_folder=None, appWrap=None)
construct me
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name(str) |
my name |
required | |
welcome(str) |
the welcome page |
required | |
template_folder(str) |
the template folder |
required |
Source code in onlinespreadsheet/profile.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 |
|
record_sync
Created on 2024-03-18
separating ui and functional concerns @author: wf
ComparisonData
dataclass
Stores the property name and the values to compare
Source code in onlinespreadsheet/record_sync.py
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 |
|
get_chosen_sync_option()
chosen sync action to apply to the compared property values Returns: SyncAction: section to apply
Source code in onlinespreadsheet/record_sync.py
61 62 63 64 65 66 67 68 69 70 71 |
|
get_sync_status()
compare the left and right value and return their sync status
Source code in onlinespreadsheet/record_sync.py
48 49 50 51 52 53 54 55 56 57 58 59 |
|
suggested_sync_action()
Evaluates the data difference and suggests a Sync Action
Source code in onlinespreadsheet/record_sync.py
73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
ComparisonRecord
Compares two dicts
Source code in onlinespreadsheet/record_sync.py
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 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 |
|
__init__(left_source_name, left_record, right_source_name, right_record)
constructor Args: left_record: record to compare right_record: record to compare
Source code in onlinespreadsheet/record_sync.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
get_update_record_of(source_name)
Get the update record for the given source name Args: source_name: name of one of the sources
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
update for the given source |
Source code in onlinespreadsheet/record_sync.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
get_update_records()
Get the update records for both sides
Returns:
Type | Description |
---|---|
(dict, dict)
|
updates that should be applied to both sides |
Source code in onlinespreadsheet/record_sync.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
SyncAction
Bases: Enum
synchronization action
Source code in onlinespreadsheet/record_sync.py
23 24 25 26 27 28 29 30 31 32 33 34 |
|
SyncRequest
dataclass
Synchronization request containing the sync action to apply and the corresponding data
Source code in onlinespreadsheet/record_sync.py
162 163 164 165 166 167 168 169 |
|
SyncStatus
Bases: Enum
synchronization status
Source code in onlinespreadsheet/record_sync.py
13 14 15 16 17 18 19 20 |
|
record_sync_view
Created on 2024-03-18
@author: wf
SyncDialog
dialog widget to synchronize two data records
Source code in onlinespreadsheet/record_sync_view.py
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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
|
__fallback_sync_callback(req)
Fallback Sync handler
Source code in onlinespreadsheet/record_sync_view.py
109 110 111 112 113 114 |
|
__init__(solution, comparison_record, sync_callback=None, value_enhancement_callback=None)
constructor
Source code in onlinespreadsheet/record_sync_view.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
enhance_row_values()
Enhance the row values
Source code in onlinespreadsheet/record_sync_view.py
116 117 118 119 120 121 122 |
|
handle_sync_action_change(msg)
Handles change in selected global sync action
Source code in onlinespreadsheet/record_sync_view.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
handover_sync_callback(action)
Generates the SyncRequest and hands it over to the defined callback function Args: action: sync action to apply
Source code in onlinespreadsheet/record_sync_view.py
100 101 102 103 104 105 106 107 |
|
setup_header()
setup header column
Source code in onlinespreadsheet/record_sync_view.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
setup_ui()
Source code in onlinespreadsheet/record_sync_view.py
37 38 39 40 |
|
SyncDialogRow
row in the SyncDialog
Source code in onlinespreadsheet/record_sync_view.py
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 |
|
__init__(data)
constructor Args: data: data to compare/sync in this row
Source code in onlinespreadsheet/record_sync_view.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
change_sync_action(_msg)
handle change in sync action
Source code in onlinespreadsheet/record_sync_view.py
182 183 184 185 186 187 188 189 190 |
|
enhance_value_display()
Enhances the displayed value
Source code in onlinespreadsheet/record_sync_view.py
192 193 194 195 |
|
get_row_color()
defines the row background color based on the sync status
Source code in onlinespreadsheet/record_sync_view.py
152 153 154 155 156 157 158 159 160 161 162 163 |
|
setup_sync_action_selector()
setup sync action selector and choose default action based on the data
Source code in onlinespreadsheet/record_sync_view.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
spreadsheet_view
Created on 2024-03-19
@author: wf
SpreadSheetView
shows a Spreadsheet
Source code in onlinespreadsheet/spreadsheet_view.py
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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
load_items_from_selected_sheet()
Extract the records from the selected sheet and returns them as LoD
Returns:
Type | Description |
---|---|
List[dict]
|
List of dicts containing the sheet content |
Source code in onlinespreadsheet/spreadsheet_view.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
load_sheet()
load sheet in background
Source code in onlinespreadsheet/spreadsheet_view.py
82 83 84 85 86 87 88 89 90 91 92 93 |
|
on_change_url(args)
async
handle selection of a different url
Source code in onlinespreadsheet/spreadsheet_view.py
108 109 110 111 112 113 114 |
|
reload()
async
reload my spreadsheet
Source code in onlinespreadsheet/spreadsheet_view.py
95 96 97 98 99 100 101 102 103 104 105 106 |
|
setup_ui()
setup my user interface
Source code in onlinespreadsheet/spreadsheet_view.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
tablequery
Created on 2021-12-09
@author: wf
QueryType
Bases: Enum
Query type
Source code in onlinespreadsheet/tablequery.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
match(pattern, string)
staticmethod
re match search for the given pattern with ignore case
Source code in onlinespreadsheet/tablequery.py
82 83 84 85 86 87 |
|
SmwWikiAccess
Access to Semantic MediaWiki
Source code in onlinespreadsheet/tablequery.py
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 |
|
__init__(wikiId, showProgress=False, queryDivision=1, debug=False, lenient=True)
constructor
Source code in onlinespreadsheet/tablequery.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
query(query)
query with auto-login
Source code in onlinespreadsheet/tablequery.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
TableQuery
Bases: object
prepare a Spreadsheet editing
Source code in onlinespreadsheet/tablequery.py
90 91 92 93 94 95 96 97 98 99 100 101 102 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 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 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 |
|
__init__(debug=False)
Constructor
Source code in onlinespreadsheet/tablequery.py
95 96 97 98 99 100 101 102 103 |
|
addAskQuery(wikiId, name, ask, title=None, description=None)
add an ask query for the given wiki
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wikiId(str) |
the id of the wiki to add |
required | |
name(str) |
the name of the query to add |
required | |
ask(str) |
the SMW ask query |
required | |
title(str) |
the title of the query |
required | |
description(str) |
the description of the query |
required |
Source code in onlinespreadsheet/tablequery.py
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 |
|
addQuery(query)
add the query with the given name to my queries
query(Query): the query to add
Source code in onlinespreadsheet/tablequery.py
105 106 107 108 109 110 111 |
|
addRESTfulQuery(name, url, title=None, description=None)
add RESTFful query to the queries
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url(str) |
RESTful query URL optionally with parameters |
required | |
name(str) |
name of the query |
required | |
title(str) |
title of the query |
required | |
description(str) |
description of the query |
required |
Source code in onlinespreadsheet/tablequery.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
addSparqlQuery(name, query, endpointUrl='https://query.wikidata.org/sparql', title=None, description=None)
add SPARQL query to the queries
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name(str) |
name of the query |
required | |
query(str) |
the SPARQL query to execute |
required | |
endpointUrl(str) |
the url of the endpoint to use |
required | |
title(str) |
title of the query |
required | |
description(str) |
description of the query |
required |
Source code in onlinespreadsheet/tablequery.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
|
fetchQueryResults()
fetch the QueryResults
Source code in onlinespreadsheet/tablequery.py
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 |
|
fromAskQueries(wikiId, askQueries, withFetch=True)
initialize me from the given Queries
Source code in onlinespreadsheet/tablequery.py
178 179 180 181 182 183 184 185 186 187 188 189 |
|
guessQueryType(query)
staticmethod
Tries to guess the query type of the given query
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query(str) |
query |
required |
Returns:
Type | Description |
---|---|
Optional[QueryType]
|
QueryType |
Source code in onlinespreadsheet/tablequery.py
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 |
|
version
Created on 2022-03-06
@author: wf
Version
dataclass
Version handling for pyOnlineSpreadsheetEditing
Source code in onlinespreadsheet/version.py
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 |
|
wdgrid
Created on 2023-01-11
@author: wf
GridSync
allow syncing the grid with data from wikibase
Source code in onlinespreadsheet/wdgrid.py
280 281 282 283 284 285 286 287 288 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 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 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 425 426 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 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 |
|
__init__(wdgrid, entityName, pk, sparql, debug=False)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wdgrid(WikiDataGrid) |
the wikidata grid to use |
required | |
entityName |
str
|
name of the sheet |
required |
pk |
str
|
primary key |
required |
sparql(SPARQL) |
the sparql endpoint access to use |
required | |
debug(bool) |
if True show debug information |
required |
Source code in onlinespreadsheet/wdgrid.py
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
|
addHtmlMarkupToViewLod(viewLod)
add HtmlMarkup to the view list of dicts viewLod(list): a list of dict for the mark result
Source code in onlinespreadsheet/wdgrid.py
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 |
|
add_record_to_wikidata(record, row_index, write=False, ignore_errors=False)
add a record to wikidata when the row has been selected
Parameters:
Name | Type | Description | Default |
---|---|---|---|
record(dict) |
the data to be added to wikidata |
required | |
row_index(int) |
the row index |
required | |
write(bool) |
if True actually write data |
required | |
ignore_errors(bool) |
if True ignore errors that might occur |
required |
Source code in onlinespreadsheet/wdgrid.py
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
|
checkCell(viewLodRow, column, value, propVarname, propType, propLabel, propUrl=None)
update the cell value for the given
Parameters:
Name | Type | Description | Default |
---|---|---|---|
viewLodRow(dict) |
the row to modify |
required | |
value(object) |
the value to set for the cell |
required | |
propVarName(str) |
the name of the property Variable set in the SPARQL statement |
required | |
propType(str) |
the abbreviation for the property Type |
required | |
propLabel(str) |
the propertyLabel (if any) |
required | |
propUrl(str) |
the propertyUrl (if any) |
required |
Source code in onlinespreadsheet/wdgrid.py
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
|
enhance_value_display(row)
Enhances the displayed value
Source code in onlinespreadsheet/wdgrid.py
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 |
|
getColumnTypeAndVarname(propName)
slightly modified getter to account for "item" special case
Parameters:
Name | Type | Description | Default |
---|---|---|---|
propName(str) |
the name of the property |
required |
Source code in onlinespreadsheet/wdgrid.py
557 558 559 560 561 562 563 564 565 566 567 568 569 570 |
|
getHtmlColumns()
get the columns that have html content(links)
Source code in onlinespreadsheet/wdgrid.py
572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 |
|
onChangePk(msg)
async
handle selection of a different primary key
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg(dict) |
the justpy message |
required |
Source code in onlinespreadsheet/wdgrid.py
382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
|
onCheckWikidata(msg=None)
check clicked - check the wikidata content
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg(dict) |
the justpy message |
required |
Source code in onlinespreadsheet/wdgrid.py
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 |
|
query(sparql)
query the wikibase instance based on the list of dict
Source code in onlinespreadsheet/wdgrid.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
|
setup(a, header)
initialize my components
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a(HtmlComponent) |
the parent component |
required | |
header(HtmlComponent) |
the header for the primary key selector |
required |
Source code in onlinespreadsheet/wdgrid.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
|
setup_aggrid_post_reload()
setup the aggrid
Source code in onlinespreadsheet/wdgrid.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
|
WikidataGrid
a grid with tabular data from wikidata to work with
Source code in onlinespreadsheet/wdgrid.py
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 89 90 91 92 93 94 95 96 97 98 99 100 101 102 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 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 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 |
|
__init__(solution, entityName, entityPluralName, source, getLod, additional_reload_callback=None, row_selected_callback=None, lodRowIndex_column='lodRowIndex', debug=False)
constructor Args: solution(Websolution): the web solution context of this grid entityName(str): the name of the entity that this grid is for entityPluralName(str): the plural name of the entity type of items displayed in this grid source(str): the name of my source (where the data for this grid comes from) getLod(Callable): the function to get my list of dicts additional_reload_callback: Function to be called after fetching the new data and before updating aggrid lodRowIndex_column(str): the column/attribute to use for tracking the index in the lod debug(bool): if True show debug information
Source code in onlinespreadsheet/wdgrid.py
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 |
|
linkWikidataItems(viewLod, itemColumn='item')
link the wikidata entries in the given item column if containing Q values
Parameters:
Name | Type | Description | Default |
---|---|---|---|
viewLod(list) |
the list of dicts for the view |
required | |
itemColumn(str) |
the name of the column to handle |
required |
Source code in onlinespreadsheet/wdgrid.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
onChangeDryRun(msg)
handle change of DryRun setting
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg(dict) |
the justpy message |
required |
Source code in onlinespreadsheet/wdgrid.py
224 225 226 227 228 229 230 231 |
|
onChangeIgnoreErrors(msg)
handle change of IgnoreErrors setting
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg(dict) |
the justpy message |
required |
Source code in onlinespreadsheet/wdgrid.py
233 234 235 236 237 238 239 240 |
|
onRowSelected(msg)
async
row selection event handler
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg(dict) |
row selection information |
required |
Source code in onlinespreadsheet/wdgrid.py
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 |
|
refreshGridSettings()
refresh the ag grid settings e.g. enable the row selection event handler enable row selection event handler
Source code in onlinespreadsheet/wdgrid.py
164 165 166 167 168 169 170 |
|
reload(_msg=None, clearErrors=True)
async
reload the table content via my getLod function
Parameters:
Name | Type | Description | Default |
---|---|---|---|
clearErrors(bool) |
if True clear Errors before reloading |
required |
Source code in onlinespreadsheet/wdgrid.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 |
|
reloadAgGrid(viewLod, showLimit=10)
reload the agGrid with the given list of Dicts
Parameters:
Name | Type | Description | Default |
---|---|---|---|
viewLod(list) |
the list of dicts for the current view |
required | |
showLimit |
int
|
number of rows to print when debugging |
10
|
Source code in onlinespreadsheet/wdgrid.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
setDefaultColDef(agGrid)
set the default column definitions Args: agGrid: agGrid to set the column definitions for
Source code in onlinespreadsheet/wdgrid.py
151 152 153 154 155 156 157 158 159 160 161 162 |
|
setViewLod(lod, nonValue='-')
add lodRowIndex column to list of dicts and use a copy of the given list of dicts for the view modify datetime columns to avoid problems with justpy
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lod(list) |
the list of dicts |
required | |
nonValue(str) |
the string to use for "None" values |
required |
Source code in onlinespreadsheet/wdgrid.py
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 |
|
setup(a)
setup the Wikidata grid nicegui components
Source code in onlinespreadsheet/wdgrid.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 |
|