GeezerVison is showing github.com — Updating docs · mirror-dump/deepdiff@96badc7
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: AUTHORS.md +1Lines changed: 1 addition & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -58,3 +58,4 @@ Authors in order of the timeline of their contributions: | 58 | 58 | - [kor4ik](https://github.com/kor4ik) for the bugfix for `include_paths` for nested dictionaries. | 59 | 59 | - [martin-kokos](https://github.com/martin-kokos) for using tomli and tomli-w for dealing with tomli files. | 60 | 60 | - [Alex Sauer-Budge](https://github.com/amsb) for the bugfix for `datetime.date`. | | 61 | +- [William Jamieson](https://github.com/WilliamJamieson) for [NumPy 2.0 compatibility](https://github.com/seperman/deepdiff/pull/422) |
Collapse file Copy file name to clipboardExpand all lines: README.md +16Lines changed: 16 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -23,6 +23,11 @@ Tested on Python 3.7+ and PyPy3. | 23 | 23 |
| 24 | 24 | Please check the [ChangeLog](CHANGELOG.md) file for the detailed information. | 25 | 25 |
| | 26 | +DeepDiff 6-6-0 | | 27 | + | | 28 | +- [Serialize To Flat Dicts]() | | 29 | +- [NumPy 2.0 compatibility](https://github.com/seperman/deepdiff/pull/422) by [William Jamieson](https://github.com/WilliamJamieson) | | 30 | + | 26 | 31 | DeepDiff 6-5-0 | 27 | 32 |
| 28 | 33 | - [parse_path](https://zepworks.com/deepdiff/current/faq.html#q-how-do-i-parse-deepdiff-result-paths) | @@ -66,10 +71,21 @@ Install optional packages: | 66 | 71 |
| 67 | 72 | Please take a look at the [CHANGELOG](CHANGELOG.md) file. | 68 | 73 |
| | 74 | +# 🛠️ Detect And Clean Messy Data In Transit | | 75 | + | | 76 | +If you deal with messy data, check out [Qluster](https://qluster.ai/solution), another tool by the creator of DeepDiff. | | 77 | + | | 78 | +*Qluster's mission is to enable users to create adaptive data pipelines that detect issues, quarantine bad data, and enable the user to fix data issues via a spreadsheet UI.* | | 79 | + | | 80 | + | 69 | 81 | # Survey | 70 | 82 |
| 71 | 83 | :mega: **Please fill out our [fast 5-question survey](https://forms.gle/E6qXexcgjoKnSzjB8)** so that we can learn how & why you use DeepDiff, and what improvements we should make. Thank you! :dancers: | 72 | 84 |
| | 85 | +# Data Cleaning | | 86 | + | | 87 | + | | 88 | + | 73 | 89 |
| 74 | 90 | # Contribute | 75 | 91 |
| |
Collapse file Copy file name to clipboardExpand all lines: docs/authors.rst +2Lines changed: 2 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -83,6 +83,8 @@ Authors in order of the timeline of their contributions: | 83 | 83 | and tomli-w for dealing with tomli files. | 84 | 84 | - `Alex Sauer-Budge <https://github.com/amsb>`__ for the bugfix for | 85 | 85 | ``datetime.date``. | | 86 | +- `William Jamieson <https://github.com/WilliamJamieson>`__ for `NumPy 2.0 | | 87 | +compatibility <https://github.com/seperman/deepdiff/pull/422>`__ | 86 | 88 |
| 87 | 89 | .. _Sep Dehpour (Seperman): http://www.zepworks.com | 88 | 90 | .. _Victor Hahn Castell: http://hahncastell.de | |
Collapse file Copy file name to clipboardExpand all lines: docs/delta.rst +9-1Lines changed: 9 additions & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -208,6 +208,14 @@ Delta Serializer | 208 | 208 |
| 209 | 209 | DeepDiff uses pickle to serialize delta objects by default. Please take a look at the :ref:`delta_deserializer_label` for more information. | 210 | 210 |
| | 211 | + | | 212 | +.. _to_flat_dicts: | | 213 | + | | 214 | +Delta Serialize To Flat Dictionaries | | 215 | +------------------------------------ | | 216 | + | | 217 | +Read about :ref:`delta_to_flat_dicts_label` | | 218 | + | 211 | 219 | .. _delta_dump_safety_label: | 212 | 220 |
| 213 | 221 | Delta Dump Safety | @@ -472,7 +480,7 @@ Unable to get the item at root['x']['y'][3]: 'x' | 472 | 480 | Unable to get the item at root['q']['t'] | 473 | 481 | {} | 474 | 482 |
| 475 | | -# Once we set the force to be True | | 483 | +Once we set the force to be True | 476 | 484 |
| 477 | 485 | >>> delta = Delta(diff, force=True) | 478 | 486 | >>> {} + delta | |
Collapse file Copy file name to clipboardExpand all lines: docs/index.rst +6Lines changed: 6 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -31,6 +31,12 @@ The DeepDiff library includes the following modules: | 31 | 31 | What Is New | 32 | 32 | *********** | 33 | 33 |
| | 34 | +DeepDiff 6-6-0 | | 35 | +-------------- | | 36 | + | | 37 | + - :ref:`delta_to_flat_dicts_label` can be used to serialize delta objects into a flat list of dictionaries. | | 38 | + - `NumPy 2.0 compatibility <https://github.com/seperman/deepdiff/pull/422>`__ by `William Jamieson <https://github.com/WilliamJamieson>`__ | | 39 | + | 34 | 40 | DeepDiff 6-5-0 | 35 | 41 | -------------- | 36 | 42 |
| |
Collapse file Copy file name to clipboardExpand all lines: docs/serialization.rst +44Lines changed: 44 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -105,4 +105,48 @@ From Json Pickle | 105 | 105 | Load the diff object from the json pickle dump. | 106 | 106 | Take a look at the above :ref:`to_json_pickle_label` for an example. | 107 | 107 |
| | 108 | + | | 109 | +.. _delta_to_flat_dicts_label: | | 110 | + | | 111 | +Delta Serialize To Flat Dictionaries | | 112 | +------------------------------------ | | 113 | + | | 114 | +Sometimes, it is desired to serialize a :ref:`delta_label` object to a list of flat dictionaries. For example, to store them in relation databases. In that case, you can use the Delta.to_flat_dicts to achieve the desired outcome. | | 115 | + | | 116 | +For example: | | 117 | + | | 118 | + >>> from pprint import pprint | | 119 | + >>> from deepdiff import DeepDiff, Delta | | 120 | + >>> t1 = {"key1": "value1"} | | 121 | + >>> t2 = {"field2": {"key2": "value2"}} | | 122 | + >>> diff = DeepDiff(t1, t2, verbose_level=2) | | 123 | + >>> pprint(diff, indent=2) | | 124 | + { 'dictionary_item_added': {"root['field2']": {'key2': 'value2'}}, | | 125 | + 'dictionary_item_removed': {"root['key1']": 'value1'}} | | 126 | + >>> | | 127 | + >>> delta = Delta(diff, verify_symmetry=True) | | 128 | + >>> flat_dicts = delta.to_flat_dicts() | | 129 | + >>> pprint(flat_dicts, indent=2) | | 130 | + [ { 'action': 'dictionary_item_added', | | 131 | + 'path': ['field2', 'key2'], | | 132 | + 'value': 'value2'}, | | 133 | + {'action': 'dictionary_item_removed', 'path': ['key1'], 'value': 'value1'}] | | 134 | + | | 135 | + | | 136 | +Example 2: | | 137 | + | | 138 | + >>> t3 = ["A", "B"] | | 139 | + >>> t4 = ["A", "B", "C", "D"] | | 140 | + >>> diff = DeepDiff(t3, t4, verbose_level=2) | | 141 | + >>> pprint(diff, indent=2) | | 142 | + {'iterable_item_added': {'root[2]': 'C', 'root[3]': 'D'}} | | 143 | + >>> | | 144 | + >>> delta = Delta(diff, verify_symmetry=True) | | 145 | + >>> flat_dicts = delta.to_flat_dicts() | | 146 | + >>> pprint(flat_dicts, indent=2) | | 147 | + [ {'action': 'iterable_item_added', 'path': [2], 'value': 'C'}, | | 148 | + {'action': 'iterable_item_added', 'path': [3], 'value': 'D'}] | | 149 | + | | 150 | + | | 151 | + | 108 | 152 | Back to :doc:`/index` |
|