DOD

Contents

DOD#

dod_print#

Help on function dod_print in module pydicts.dod:

dod_print(dod_, indent=4, depth=None, width=80, sort_dicts=True)
    Make a nice print of a dictionary of nested dictionaries
from pydicts import dod
from datetime import date, datetime
from decimal import Decimal
d={"a": datetime.now(), "b": date.today(), "c": Decimal('12.32'), "d": None, "e": int(12), "f":None, "g":True, "h":False,  "nested": {"x":1, "y":2, "z":{"n":4, "m":5, "o":6}}}
dod_={}
dod_["first"]=d
dod_["second"]=d
dod.dod_print(dod_)
{   'first': {   'a': datetime.datetime(2024, 7, 10, 5, 47, 42, 808698),
                 'b': datetime.date(2024, 7, 10),
                 'c': Decimal('12.32'),
                 'd': None,
                 'e': 12,
                 'f': None,
                 'g': True,
                 'h': False,
                 'nested': {'x': 1, 'y': 2, 'z': {'m': 5, 'n': 4, 'o': 6}}},
    'second': {   'a': datetime.datetime(2024, 7, 10, 5, 47, 42, 808698),
                  'b': datetime.date(2024, 7, 10),
                  'c': Decimal('12.32'),
                  'd': None,
                  'e': 12,
                  'f': None,
                  'g': True,
                  'h': False,
                  'nested': {'x': 1, 'y': 2, 'z': {'m': 5, 'n': 4, 'o': 6}}}}