{ "info": { "author": "Seperman", "author_email": "sep@zepworks.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Topic :: Software Development" ], "description": "# deepdiff v 0.6.1\n\n![Downloads](https://img.shields.io/pypi/dm/pivotal-deepdiff.svg?style=flat)\n![Python Versions](https://img.shields.io/pypi/pyversions/pivotal-deepdiff.svg?style=flat)\n![License](https://img.shields.io/pypi/l/deepdiff.svg?version=latest)\n\nDeep Difference of dictionaries, iterables, strings and other objects. It will recursively look for all the changes.\nTested on Python 2.7 and 3.4\n\n#### Note:\n_This fork provides for changes specifically around handling rounding in float related fields_\n\n\n## Installation\n\n### Install from PyPi:\n\n pip install deepdiff\n\n### Importing\n\n```python\n>>> from deepdiff import DeepDiff\n```\n\n## Supported data types\n\nint, string, dictionary, list, tuple, set, frozenset, OrderedDict, NamedTuple and custom objects!\n\n\n## Examples\n\n### Same object returns empty\n\n```python\n>>> t1 = {1:1, 2:2, 3:3}\n>>> t2 = t1\n>>> ddiff = DeepDiff(t1, t2)\n>>> ddiff\n{}\n```\n\n### Type of an item has changed\n\n```python\n>>> t1 = {1:1, 2:2, 3:3}\n>>> t2 = {1:1, 2:\"2\", 3:3}\n>>> ddiff = DeepDiff(t1, t2)\n>>> print (ddiff)\n{'type_changes': [\"root[2]: 2= ===> 2=\"]}\n```\n\n### Value of an item has changed\n\n```python\n>>> t1 = {1:1, 2:2, 3:3}\n>>> t2 = {1:1, 2:4, 3:3}\n>>> ddiff = DeepDiff(t1, t2)\n>>> print (ddiff)\n{'values_changed': ['root[2]: 2 ===> 4']}\n```\n\n### Item added and/or removed\n\n```python\n>>> t1 = {1:1, 2:2, 3:3, 4:4}\n>>> t2 = {1:1, 2:4, 3:3, 5:5, 6:6}\n>>> ddiff = DeepDiff(t1, t2)\n>>> pprint (ddiff)\n{'dic_item_added': ['root[5, 6]'],\n 'dic_item_removed': ['root[4]'],\n 'values_changed': ['root[2]: 2 ===> 4']}\n```\n\n### String difference\n\n```python\n>>> t1 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":\"world\"}}\n>>> t2 = {1:1, 2:4, 3:3, 4:{\"a\":\"hello\", \"b\":\"world!\"}}\n>>> ddiff = DeepDiff(t1, t2)\n>>> from pprint import pprint\n>>> pprint (ddiff, indent = 2)\n{ 'values_changed': [ 'root[2]: 2 ===> 4',\n \"root[4]['b']: 'world' ===> 'world!'\"]}\n>>>\n>>> print (ddiff['values_changed'][1])\nroot[4]['b']: 'world' ===> 'world!'\n```\n\n### String difference 2\n\n```python\n>>> t1 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":\"world!\\nGoodbye!\\n1\\n2\\nEnd\"}}\n>>> t2 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":\"world\\n1\\n2\\nEnd\"}}\n>>> ddiff = DeepDiff(t1, t2)\n>>> pprint (ddiff, indent = 2)\n{ 'values_changed': [ \"root[4]['b']:\\n\"\n '--- \\n'\n '+++ \\n'\n '@@ -1,5 +1,4 @@\\n'\n '-world!\\n'\n '-Goodbye!\\n'\n '+world\\n'\n ' 1\\n'\n ' 2\\n'\n ' End']}\n>>>\n>>> print (ddiff['values_changed'][0])\nroot[4]['b']:\n--- \n+++ \n@@ -1,5 +1,4 @@\n-world!\n-Goodbye!\n+world\n 1\n 2\n End\n```\n\n### Type change\n\n```python\n>>> t1 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":[1, 2, 3]}}\n>>> t2 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":\"world\\n\\n\\nEnd\"}}\n>>> ddiff = DeepDiff(t1, t2)\n>>> pprint (ddiff, indent = 2)\n{ 'type_changes': [ \"root[4]['b']: [1, 2, 3]= ===> world\\n\"\n '\\n'\n '\\n'\n \"End=\"]}\n```\n\n### List difference\n\n```python\n>>> t1 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":[1, 2, 3]}}\n>>> t2 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":[1, 2]}}\n>>> ddiff = DeepDiff(t1, t2)\n>>> pprint (ddiff, indent = 2)\n{'iterable_item_removed': [\"root[4]['b']: [3]\"]}\n```\n\n### List difference 2\n\n```python\n>>> t1 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":[1, 2, 3]}}\n>>> t2 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":[1, 3, 2, 3]}}\n>>> ddiff = DeepDiff(t1, t2)\n>>> pprint (ddiff, indent = 2)\n{ 'iterable_item_added': [\"root[4]['b']: [3]\"],\n 'values_changed': [\"root[4]['b'][1]: 2 ===> 3\", \"root[4]['b'][2]: 3 ===> 2\"]}\n```\n\n### List that contains dictionary:\n\n```python\n>>> t1 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":[1, 2, {1:1, 2:2}]}}\n>>> t2 = {1:1, 2:2, 3:3, 4:{\"a\":\"hello\", \"b\":[1, 2, {1:3}]}}\n>>> ddiff = DeepDiff(t1, t2)\n>>> pprint (ddiff, indent = 2)\n{ 'dic_item_removed': [\"root[4]['b'][2][2]\"],\n 'values_changed': [\"root[4]['b'][2][1]: 1 ===> 3\"]}\n```\n\n### Sets\n\n```python\n>>> t1 = {1, 2, 8}\n>>> t2 = {1, 2, 3, 5}\n>>> ddiff = DeepDiff(t1, t2)\n>>> print (DeepDiff(t1, t2))\n{'set_item_added': ['root: [3, 5]'], 'set_item_removed': ['root: [8]']}\n```\n\n### Named Tuples:\n\n```python\n>>> from collections import namedtuple\n>>> Point = namedtuple('Point', ['x', 'y'])\n>>> t1 = Point(x=11, y=22)\n>>> t2 = Point(x=11, y=23)\n>>> print (DeepDiff(t1, t2))\n{'values_changed': ['root.y: 22 ===> 23']}\n```\n\n### Custom objects:\n\n```python\n>>> class ClassA(object):\n... a = 1\n... def __init__(self, b):\n... self.b = b\n...\n>>> t1 = ClassA(1)\n>>> t2 = ClassA(2)\n>>>\n>>> print(DeepDiff(t1, t2))\n{'values_changed': ['root.b: 1 ===> 2']}\n```\n\n### Object attribute added:\n\n```python\n>>> t2.c = \"new attribute\"\n>>> print(DeepDiff(t1, t2))\n{'attribute_added': ['root.c'], 'values_changed': ['root.b: 1 ===> 2']}\n```\n\n### Ignoring order:\n\n**Note: If your objects include iterable containing any unhashable item, ignoring the order can be expensive.**\n\n```python\n>>> t1 = [{\"a\": 2}, {\"b\": [3, 4, {1: 1}]}]\n>>> t2 = [{\"b\": [3, 4, {1: 1}]}, {\"a\": 2}]\nddiff = DeepDiff(t1, t2, ignore_order=True)\n>>>\n>>> print(DeepDiff(t1, t2))\n{}\n```\n\n## Documentation\n\n\n\n### Build Process:\n1. Update the `__version_info__` inside of the application. Commit and push.\n2. Tag the release with the version. `git tag -m \"Release\"; git push --tags`\n3. Build the release `rm -rf dist build *egg-info; python setup.py sdist bdist_wheel`\n4. Upload the data `twine upload dist/*`\n\n## Changelog\n- See https://github.com/pivotal-energy-solutions/deepdiff/release\n\n## Original Author\n\nSeperman\nGithub: \nLinkedin: \nZepWorks: \n\n\nThanks to:\nbrbsix for initial Py3 porting\nWangFenjin for unicode support\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/pivotal-energy-solutions/deepdiff/archive/0.6.3.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pivotal-energy-solutions/deepdiff", "keywords": "diff development", "license": "", "maintainer": "", "maintainer_email": "", "name": "pivotal-deepdiff", "package_url": "https://pypi.org/project/pivotal-deepdiff/", "platform": "", "project_url": "https://pypi.org/project/pivotal-deepdiff/", "project_urls": { "Bug Reports": "https://github.com/pivotal-energy-solutions/deepdiff/issues", "Download": "https://github.com/pivotal-energy-solutions/deepdiff/archive/0.6.3.tar.gz", "Homepage": "https://github.com/pivotal-energy-solutions/deepdiff", "Say Thanks!": "https://saythanks.io/to/rh0dium", "Source": "https://github.com/seperman/deepdiff" }, "release_url": "https://pypi.org/project/pivotal-deepdiff/0.6.3/", "requires_dist": null, "requires_python": "", "summary": "Deep Difference of dictionaries, iterables, strings and other objects. It will recursively look for all the changes.", "version": "0.6.3" }, "last_serial": 3808655, "releases": { "0.6.2": [ { "comment_text": "", "digests": { "md5": "33c72bbdac8e6230ef16b0e594bf454c", "sha256": "46b2c576673a4b887caf5d575fc94fe09a45adf8c697588b378fd55e20b882a4" }, "downloads": -1, "filename": "pivotal_deepdiff-0.6.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "33c72bbdac8e6230ef16b0e594bf454c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8982, "upload_time": "2018-04-23T14:55:53", "url": "https://files.pythonhosted.org/packages/81/dd/a72266a8c3db340c2be05e7eb5c9d3e1d8d809ef9796cc35ef770610b284/pivotal_deepdiff-0.6.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4f7d30c0ed568c6968ea01d2335024ed", "sha256": "d1c9b11e471059ea332b669994534c55705918b790f23f4976957db0c5bda323" }, "downloads": -1, "filename": "pivotal_deepdiff-0.6.2.tar.gz", "has_sig": false, "md5_digest": "4f7d30c0ed568c6968ea01d2335024ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11384, "upload_time": "2018-04-23T14:55:54", "url": "https://files.pythonhosted.org/packages/df/50/c230e99ef0cc8f4cb8d8335e86e4f699270291198c2cd3fedf4b08c28a96/pivotal_deepdiff-0.6.2.tar.gz" } ], "0.6.3": [ { "comment_text": "", "digests": { "md5": "c821e9d49712ca247bdde0bf1ad5760f", "sha256": "2ce8131f0209383b0740442425f9c232d41ab46757be7c40ad7a727d0a26c33c" }, "downloads": -1, "filename": "pivotal_deepdiff-0.6.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c821e9d49712ca247bdde0bf1ad5760f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8983, "upload_time": "2018-04-23T15:10:14", "url": "https://files.pythonhosted.org/packages/87/d2/cefc259d408f11179772a497dbe4458e4523dfb51885e826c58fedd79c45/pivotal_deepdiff-0.6.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61c5b86a98228bd394fcff1dedec6c82", "sha256": "750d524592a7e4c8359b9cfa009e2b7388961b6b7045cedffd42672c24474246" }, "downloads": -1, "filename": "pivotal_deepdiff-0.6.3.tar.gz", "has_sig": false, "md5_digest": "61c5b86a98228bd394fcff1dedec6c82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11426, "upload_time": "2018-04-23T15:10:16", "url": "https://files.pythonhosted.org/packages/c6/a5/fee63e9837075b12da5e19a676883dcf7b231c9209ebac9841543753cb6b/pivotal_deepdiff-0.6.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c821e9d49712ca247bdde0bf1ad5760f", "sha256": "2ce8131f0209383b0740442425f9c232d41ab46757be7c40ad7a727d0a26c33c" }, "downloads": -1, "filename": "pivotal_deepdiff-0.6.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c821e9d49712ca247bdde0bf1ad5760f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8983, "upload_time": "2018-04-23T15:10:14", "url": "https://files.pythonhosted.org/packages/87/d2/cefc259d408f11179772a497dbe4458e4523dfb51885e826c58fedd79c45/pivotal_deepdiff-0.6.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "61c5b86a98228bd394fcff1dedec6c82", "sha256": "750d524592a7e4c8359b9cfa009e2b7388961b6b7045cedffd42672c24474246" }, "downloads": -1, "filename": "pivotal_deepdiff-0.6.3.tar.gz", "has_sig": false, "md5_digest": "61c5b86a98228bd394fcff1dedec6c82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11426, "upload_time": "2018-04-23T15:10:16", "url": "https://files.pythonhosted.org/packages/c6/a5/fee63e9837075b12da5e19a676883dcf7b231c9209ebac9841543753cb6b/pivotal_deepdiff-0.6.3.tar.gz" } ] }