VOOZH about

URL: https://pypi.org/project/deepmerge/

โ‡ฑ deepmerge ยท PyPI


Skip to main content

deepmerge 2.1.0

pip install deepmerge

Latest release

Released:

A toolset for deeply merging Python dictionaries.

Navigation

Verified details

These details have been verified by PyPI
Maintainers
๐Ÿ‘ Avatar for Yusuke.Tsutsumi from gravatar.com
Yusuke.Tsutsumi

Unverified details

These details have not been verified by PyPI
Project links
Meta
  • License: MIT License (MIT Licence)
  • Author: Yusuke Tsutsumi
  • Requires: Python >=3.8
  • Provides-Extra: dev

Project description

๐Ÿ‘ https://img.shields.io/pypi/v/deepmerge.svg
๐Ÿ‘ https://img.shields.io/pypi/status/deepmerge.svg
๐Ÿ‘ https://img.shields.io/pypi/pyversions/pillar.svg
๐Ÿ‘ https://img.shields.io/github/license/toumorokoshi/deepmerge.svg
๐Ÿ‘ https://github.com/toumorokoshi/deepmerge/actions/workflows/python-package.yaml/badge.svg

A tool to handle merging of nested data structures in Python.

Installation

deepmerge is available on pypi:

pipinstalldeepmerge

Example

Generic Strategy

fromdeepmergeimport always_mergerbase = {"foo": ["bar"]}next = {"foo": ["baz"]}expected_result = {'foo': ['bar', 'baz']}result = always_merger.merge(base, next)assert expected_result == result

Custom Strategy

fromdeepmergeimport Mergermy_merger = Merger( # pass in a list of tuple, with the # strategies you are looking to apply # to each type. [ (list, ["append"]), (dict, ["merge"]), (set, ["union"]) ], # next, choose the fallback strategies, # applied to all other types: ["override"], # finally, choose the strategies in # the case where the types conflict: ["override"])base = {"foo": ["bar"]}next = {"bar": "baz"}my_merger.merge(base, next)assert base == {"foo": ["bar"], "bar": "baz"}

You can also pass in your own merge functions, instead of a string.

For more information, see the docs

Supported Versions

deepmerge is supported on Python 3.8+.

For older Python versions the last supported version of deepmerge is listed below:

  • 3.7 : 1.1.1

Project details

Verified details

These details have been verified by PyPI
Maintainers
๐Ÿ‘ Avatar for Yusuke.Tsutsumi from gravatar.com
Yusuke.Tsutsumi

Unverified details

These details have not been verified by PyPI
Project links
Meta
  • License: MIT License (MIT Licence)
  • Author: Yusuke Tsutsumi
  • Requires: Python >=3.8
  • Provides-Extra: dev

Release history Release notifications | RSS feed

Download files

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

Source Distribution

deepmerge-2.1.0.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

Filter files by name, interpreter, ABI, and platform.

If you're not sure about the file name format, learn more about wheel file names.

Copy a direct link to the current filters

deepmerge-2.1.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file deepmerge-2.1.0.tar.gz.

File metadata

  • Download URL: deepmerge-2.1.0.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for deepmerge-2.1.0.tar.gz
Algorithm Hash digest
SHA256 07ca7a7b8935df596c512fa8161877c0487ac61f691c07766e7d71d2b23bdd2f
MD5 fa1e84ec7b42cffd921d10f3eea2644d
BLAKE2b-256 2a786e9e20106224083cfb817d2d3c26e80e72258d617b616721a169b87081e0

See more details on using hashes here.

File details

Details for the file deepmerge-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: deepmerge-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for deepmerge-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f148339a91d680a75ecb74ade235d9e759a93df373a0b04e9d31c8666cfeb75
MD5 c5eb462a3e04d8d2e25b809f4f7b55c5
BLAKE2b-256 51252a75b47cb057b1e164c604fb81ab690a6cdb5e2260ce651194eae90f64a3

See more details on using hashes here.

Supported by

๐Ÿ‘ Image
AWS Cloud computing and Security Sponsor ๐Ÿ‘ Image
Datadog Monitoring ๐Ÿ‘ Image
Depot Continuous Integration ๐Ÿ‘ Image
Fastly CDN ๐Ÿ‘ Image
Google Download Analytics ๐Ÿ‘ Image
Pingdom Monitoring ๐Ÿ‘ Image
Sentry Error logging ๐Ÿ‘ Image
StatusPage Status page