Skip to content

Commit cb59fd3

Browse files
authored
feat: Additional DoclingDocument methods for use in MCP document manipulation (#344)
* insert_* methods and range manipulation methods * DCO Remediation Commit for Ryan Fernandes <[email protected]> I, Ryan Fernandes <[email protected]>, hereby add my Signed-off-by to this commit: cc0c4b2 Signed-off-by: Ryan Fernandes <[email protected]> * insert_node_items method with recursive _append_item_copies helper for cross-document manipulation Signed-off-by: Ryan Fernandes <[email protected]> * add_node_items complement to inser_node_items, refactored extract_items_range to be more robust, added insert/add_document Signed-off-by: Ryan Fernandes <[email protected]> * Extended table data editing functionality Signed-off-by: Ryan Fernandes <[email protected]> * Added new document manipulation tests * Extra gt files * Refactor for reusable code - table methods * Private methods for more concise insert_* methods Signed-off-by: Ryan Fernandes <[email protected]> * Docstring changes Signed-off-by: Ryan Fernandes <[email protected]> * ValueError for failed insertions Signed-off-by: Ryan Fernandes <[email protected]> * DCO Remediation Commit for Ryan Fernandes <[email protected]> I, Ryan Fernandes <[email protected]>, hereby add my Signed-off-by to this commit: 01e8b9c I, Ryan Fernandes <[email protected]>, hereby add my Signed-off-by to this commit: 8c016d9 I, Ryan Fernandes <[email protected]>, hereby add my Signed-off-by to this commit: 3089002 Signed-off-by: Ryan Fernandes <[email protected]> --------- Signed-off-by: Ryan Fernandes <[email protected]>
1 parent 5d276bd commit cb59fd3

11 files changed

+19749
-13
lines changed

docling_core/types/doc/document.py

Lines changed: 1149 additions & 13 deletions
Large diffs are not rendered by default.

test/data/doc/constructed_doc.added_extracted_doc.json.gt

Lines changed: 2191 additions & 0 deletions
Large diffs are not rendered by default.

test/data/doc/constructed_doc.bulk_item_addition.json.gt

Lines changed: 2086 additions & 0 deletions
Large diffs are not rendered by default.

test/data/doc/constructed_doc.bulk_item_insertion.json.gt

Lines changed: 2116 additions & 0 deletions
Large diffs are not rendered by default.

test/data/doc/constructed_doc.deleted_items_range.json.gt

Lines changed: 1375 additions & 0 deletions
Large diffs are not rendered by default.

test/data/doc/constructed_doc.extracted_with_deletion.json.gt

Lines changed: 1599 additions & 0 deletions
Large diffs are not rendered by default.

test/data/doc/constructed_doc.inserted_extracted_doc.json.gt

Lines changed: 2782 additions & 0 deletions
Large diffs are not rendered by default.

test/data/doc/constructed_doc.inserted_items_with_insert_*.json.gt

Lines changed: 1959 additions & 0 deletions
Large diffs are not rendered by default.

test/data/doc/constructed_doc.inserted_list_items_with_insert_*.json.gt

Lines changed: 2055 additions & 0 deletions
Large diffs are not rendered by default.

test/data/doc/constructed_doc.manipulated_table.json.gt

Lines changed: 2190 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)