Skip to main content

Extension of the in-build dict type.

Project description

bigt

Extension of the in-build dict type. Main reason is to add merge and issubset methods to simplify working with nested dictionaries.

Examples:

from bigt.dictext import DictExt

a = {"a": {"a": "str", "b": 123}}
b = {"a": {"a": "str", "b": 1234}}
result, not_present, changed = DictExt(b).issubset(a)
assert not result
assert changed == {"a": {"b": {"old": 1234, "new": 123} } }
assert not not_present
>>> DictExt({"a": 3, "b": [{"b": 123}]}) + DictExt({"a": 1, "c": False, "b": [{"a": 12.64}]})
{'a': 1, 'b': [{'b': 123, 'a': 12.64}], 'c': False}
>>> DictExt({"aa": 3, "a": [{"b": {"bv": 1, "bc": 2}, "a": 1}, [3,1,8,5]]}).sort()
{'a': [[1, 3, 5, 8], {'a': 1, 'b': {'bc': 2, 'bv': 1}}], 'aa': 3}

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

Bigt-2019.1.5-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

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