Skip to main content

Dictdiffer is a library that helps you to diff and patch dictionaries.

Project description

https://img.shields.io/travis/inveniosoftware/dictdiffer.svg https://img.shields.io/coveralls/inveniosoftware/dictdiffer.svg https://img.shields.io/github/tag/inveniosoftware/dictdiffer.svg https://img.shields.io/pypi/dm/dictdiffer.svg https://img.shields.io/github/license/inveniosoftware/dictdiffer.svg

About

Dictdiffer is a helper module that helps you to diff and patch dictionaries.

Installation

Dictdiffer is on PyPI so all you need is:

pip install dictdiffer

Documentation

Documentation is readable at http://dictdiffer.readthedocs.io or can be built using Sphinx:

pip install dictdiffer[docs]
python setup.py build_sphinx

Testing

Running the test suite is as simple as:

./run-tests.sh

Changes

Version 0.7.2 (released 2019-02-22)

  • Two NaN values are considered the same, hence they are not shown in diff output. (#114) (@t-b)

  • Refactors diff method to reduce recursive call stack size. (#112) (@yoyonel)

  • Python porting best practice use feature detection instead of version detection to save an import and pass both PyLint and Flake8 tests with neither ‘pragma’ nor ‘noqa’. (@cclauss)

Version 0.7.1 (released 2018-05-04)

  • Resolves issue with keys containing dots. (#101)

Version 0.7.0 (released 2017-10-16)

  • Fixes problem with diff results that reference the original structure by introduction of deepcopy for all possibly unhashable items. Thus the diff does not change later when the diffed structures change.

  • Adds new option for patching and reverting patches in-place.

  • Adds Python 3.6 to test matrix.

  • Fixes the ignore argument when it contains a unicode value.

Version 0.6.1 (released 2016-11-22)

  • Changes order of items for REMOVE section of generated patches when swap is called so the list items are removed from the end. (#85)

  • Improves API documentation for ignore argument in diff function. (#79)

  • Executes doctests during PyTest invocation.

Version 0.6.0 (released 2016-06-22)

  • Adds support for comparing NumPy arrays. (#68)

  • Adds support for comparing mutable mappings, sequences and sets from collections.abs module. (#67)

  • Updates package structure, sorts imports and runs doctests.

  • Fixes order in which handled conflicts are unified so that the Merger’s unified_patches can be always applied.

Version 0.5.0 (released 2016-01-04)

  • Adds tolerance parameter used when user wants to treat closed values as equals

  • Adds support for comparing numerical values and NaN. (#54) (#55)

Version 0.4.0 (released 2015-03-11)

  • Adds support for diffing and patching of sets. (#44)

  • New tests for diff on the same lists. (#48)

  • Fix for exception when dict has unicode keys and ignore parameter is provided. (#50)

  • PEP8 improvements.

Version 0.3.0 (released 2014-11-05)

  • Adds ignore argument to diff function that allows skipping check on specified keys. (#34 #35)

  • Fix for diffing of dict or list subclasses. (#37)

  • Better instance checking of diffing objects. (#39)

Version 0.2.0 (released 2014-09-29)

  • Fix for empty list instructions. (#30)

  • Regression test for empty list instructions.

Version 0.1.0 (released 2014-09-01)

  • Fix for list removal issues during patching caused by wrong iteration. (#10)

  • Fix for issues with multiple value types for the same key. (#10)

  • Fix for issues with strings handled as iterables. (#6)

  • Fix for integer keys. (#12)

  • Regression test for complex dictionaries. (#4)

  • Better testing with Travis CI, tox, pytest, code coverage. (#10)

  • Initial release of documentation on ReadTheDocs. (#21 #24)

  • Support for Python 3. (#15)

Version 0.0.4 (released 2014-01-04)

  • List diff behavior treats lists as lists instead of sets. (#3)

  • Differed typed objects are flagged as changed now.

  • Swap function refactored.

Version 0.0.3 (released 2013-05-26)

  • Initial public release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dictdiffer-0.7.2.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

dictdiffer-0.7.2-py2.py3-none-any.whl (17.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dictdiffer-0.7.2.tar.gz.

File metadata

  • Download URL: dictdiffer-0.7.2.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.4.6

File hashes

Hashes for dictdiffer-0.7.2.tar.gz
Algorithm Hash digest
SHA256 b6eed4cf74ed31ae9646257a9f802bb09e545ca817d5c0119d747b6a05b6a22d
MD5 e36eec01d7bc966db9f134bf64c65501
BLAKE2b-256 171564f26a8a8e7f7f0f06c6e55ab11b45a098762ed3f80e9457848f7a0501d7

See more details on using hashes here.

File details

Details for the file dictdiffer-0.7.2-py2.py3-none-any.whl.

File metadata

  • Download URL: dictdiffer-0.7.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.4.6

File hashes

Hashes for dictdiffer-0.7.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cc398dc26600cdb9519b2c768157333a0967b24d64c3913077dd0794274395da
MD5 9218a719e55d6fc28a18660ea63d9465
BLAKE2b-256 e353fc8bba4d72db545c6642280ecaa330815faaa0293f8412c0f87c966015a4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page