Skip to main content

Python deepops module

Project description

PYTHON DEEPOPS MODULE

This module contains some functions for performing "deep" operations on standard Python "compound" data structures - lists/sets/dictionaries:

  • deepmerge() - merges two compound structures, including all sub-items, e.g. items to lists and sets, missing keys/items to dictionaries, optionally replacing clashing simple types.
  • deepremoveitems() - removes items (simple types, or whole compound structures) from within another compound data structure.
  • deepfilter() - returns the part of one compound structure that is matched by the other: essentially the opposite of deepremoveitems().
  • deepdiff() - compares two compound structures and returns a tuple of items to be removed and items to be updated: these could be passed to deepremoveitems() and deepmerge(), respectively, to transform one into the other (although note that they would need to be deepcopy()ed first).
  • deepsetdefault() - similar to dict.setdefault() except that it can set the default at arbitrarily deep paths into a dictionary.
  • deepget() - similar to dict.get() but can copy with arbitrarily deep paths into an indexable structure.

The module was developed and used under Python 3.4-3.7 but seems to work OK in basic testing under 2.7.

Author

Robert Franklin rcf@mince.net, UK

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

deepops-1.8.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

deepops-1.8-py2.py3-none-any.whl (19.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file deepops-1.8.tar.gz.

File metadata

  • Download URL: deepops-1.8.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for deepops-1.8.tar.gz
Algorithm Hash digest
SHA256 240d9f7bcab3f0745ef0da3c5691f3b742e1ce8a9d33b15b4d1f474585bec0eb
MD5 49b62bd6cfd4fb3bab2a5085dc7a5361
BLAKE2b-256 ef04026843ae21d4896593d8376e3d1d6342e200a4ba5a133f02d57505f9941c

See more details on using hashes here.

File details

Details for the file deepops-1.8-py2.py3-none-any.whl.

File metadata

  • Download URL: deepops-1.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for deepops-1.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 51bd1898d262c96b2e2c5fd26d1ebafac84647910024b7090670ae0467209d5d
MD5 8607f050daf5f1381293fc75a833291e
BLAKE2b-256 26f230f0e17d6cf77f5f54dc0145d0b6f9872a4ddde4309454dcc20f9e087241

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