You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DeepDiff prefers to use Murmur3 for hashing. However you have to manually install Murmur3 by running:
29
+
30
+
`pip install mmh3`
31
+
32
+
Otherwise DeepDiff will be using SHA256 for hashing which is a cryptographic hash and is considerably slower.
33
+
34
+
If you are running into trouble installing Murmur3, please take a look at the [Troubleshoot](#troubleshoot) section.
27
35
28
36
### Importing
29
37
@@ -388,8 +396,25 @@ And here is more info: <http://zepworks.com/blog/diff-it-to-digg-it/>
388
396
389
397
<http://deepdiff.readthedocs.io/en/latest/>
390
398
399
+
# Troubleshoot
400
+
401
+
## Murmur3
402
+
403
+
`Failed to build mmh3 when installing DeepDiff`
404
+
405
+
DeepDiff prefers to use Murmur3 for hashing. However you have to manually install murmur3 by running: `pip install mmh3`
406
+
407
+
On MacOS Mojave some user experience difficulty when installing Murmur3.
408
+
409
+
The problem can be solved by running:
410
+
411
+
`xcode-select --install`
412
+
413
+
And then running `pip install mmh3`
414
+
391
415
# ChangeLog
392
416
417
+
- v4-0-1: Fixing installation Tarball missing requirements.txt . DeepDiff v4+ should not show up as pip installable for Py2. Making Murmur3 installation optional.
393
418
- v4-0-0: Ending Python 2 support, Adding more functionalities and documentation for DeepHash. Switching to Pytest for testing. Switching to Murmur3 128bit for hashing. Fixing classes which inherit from classes with slots didn't have all of their slots compared. Renaming ContentHash to DeepHash. Adding exclude by path and regex path to DeepHash. Adding ignore_type_in_groups. Adding match_string to DeepSearch. Adding Timedelta object diffing.
394
419
- v3-5-0: Exclude regex path
395
420
- v3-3-0: Searching for objects and class attributes
logger.warning('Can not find Murmur3 hashing installed. Switching to SHA256 as the default hash. Refer to https://github.com/seperman/deepdiff#murmur3 for more info.')
Copy file name to clipboardExpand all lines: deepdiff/deephash_doc.rst
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ At the core of it, DeepHash is a deterministic serialization of your object into
10
10
can be passed to a hash function. By default it uses Murmur 3 128 bit hash function which is a
11
11
fast, non-cryptographic hashing function. You have the option to pass any another hashing function to be used instead.
12
12
13
+
If it can't find Murmur3 package (mmh3) installed, it uses Python's built-in SHA256 for hashing which is considerably slower than Murmur3. So it is advised that you install Murmur3 by running `pip install mmh3`
14
+
13
15
**Import**
14
16
>>> from deepdiff import DeepHash
15
17
@@ -89,13 +91,10 @@ By setting it to True, both the string and bytes of hello return the same hash.
So for example ddiff['dictionary_item_removed'] is a set if strings thus this is called the text view.
94
+
So for example ddiff['dictionary_item_added'] is a set of strings thus this is called the text view.
95
95
96
96
.. seealso::
97
97
The following examples are using the *default text view.*
@@ -328,7 +328,7 @@ The shortcuts are ignore_string_type_changes which by default is False and ignor
328
328
329
329
For example lets say you have specifically str and byte datatypes to be ignored for type changes. Then you have a couple of options:
330
330
331
-
1. Set ignore_string_type_changes=True which is the default.
331
+
1. Set ignore_string_type_changes=True.
332
332
2. Or set ignore_type_in_groups=[(str, bytes)]. Here you are saying if we detect one type to be str and the other one bytes, do not report them as type change. It is exactly as passing ignore_type_in_groups=[DeepDiff.strings] or ignore_type_in_groups=DeepDiff.strings .
333
333
334
334
Now what if you want also typeA and typeB to be ignored when comparing agains each other?
Copy file name to clipboardExpand all lines: docs/index.rst
+45-1Lines changed: 45 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
contain the root `toctree` directive.
5
5
6
6
7
-
DeepDiff 4.0.0 documentation!
7
+
DeepDiff 4.0.1 documentation!
8
8
=============================
9
9
10
10
**DeepDiff: Deep Difference of dictionaries, iterables, strings and other objects. It will recursively look for all the changes.**
@@ -25,6 +25,15 @@ Install from PyPi::
25
25
26
26
pip install deepdiff
27
27
28
+
DeepDiff prefers to use Murmur3 for hashing. However you have to manually install Murmur3 by running::
29
+
30
+
pip install mmh3
31
+
32
+
Otherwise DeepDiff will be using SHA256 for hashing which is a cryptographic hash and is considerably slower.
33
+
34
+
If you are running into trouble installing Murmur3, please take a look at the `Troubleshoot <#troubleshoot>`__ section.
35
+
36
+
28
37
Importing
29
38
~~~~~~~~~
30
39
@@ -38,6 +47,12 @@ Importing
38
47
DeepDiff
39
48
********
40
49
50
+
Read The DeepDiff details in:
51
+
52
+
:doc:`/diff`
53
+
54
+
Short introduction::
55
+
41
56
Supported data types
42
57
~~~~~~~~~~~~~~~~~~~~
43
58
@@ -174,6 +189,12 @@ The core of DeepHash is a deterministic serialization of your object into a stri
174
189
can be passed to a hash function. By default it uses Murmur 3 128 bit hash function.
175
190
but you can pass another hash function to it if you want.
176
191
192
+
Read the details at:
193
+
194
+
:doc:`/deephash`
195
+
196
+
Examples:
197
+
177
198
Let's say you have a dictionary object.
178
199
179
200
.. code:: python
@@ -216,6 +237,28 @@ Read more in the Deep Hash reference:
216
237
:doc:`/deephash`
217
238
218
239
240
+
************
241
+
Troubleshoot
242
+
************
243
+
244
+
Murmur3
245
+
~~~~~~~
246
+
247
+
`Failed to build mmh3 when installing DeepDiff`
248
+
249
+
DeepDiff prefers to use Murmur3 for hashing. However you have to manually install murmur3 by running: `pip install mmh3`
250
+
251
+
On MacOS Mojave some user experience difficulty when installing Murmur3.
252
+
253
+
The problem can be solved by running:
254
+
255
+
`xcode-select --install`
256
+
257
+
And then running
258
+
259
+
`pip install mmh3`
260
+
261
+
219
262
References
220
263
==========
221
264
@@ -238,6 +281,7 @@ Indices and tables
238
281
Changelog
239
282
=========
240
283
284
+
- v4-0-1: Fixing installation Tarball missing requirements.txt . DeepDiff v4+ should not show up as pip installable for Py2. Making Murmur3 installation optional.
241
285
- v4-0-0: Ending Python 2 support, Adding more functionalities and documentation for DeepHash. Switching to Pytest for testing. Switching to Murmur3 128bit for hashing. Fixing classes which inherit from classes with slots didn't have all of their slots compared. Renaming ContentHash to DeepHash. Adding exclude by path and regex path to DeepHash. Adding ignore_type_in_groups. Adding match_string to DeepSearch. Adding Timedelta object diffing.
242
286
- v3-5-0: Exclude regex path
243
287
- v3-3-0: Searching for objects and class attributes
0 commit comments