Skip to content

Instantly share code, notes, and snippets.

"""
Install requirements
> pip install pandas openpyxl python-dateutil more-itertools pymt5adapter pytz
"""
import argparse
import datetime as dt
import math
from pathlib import Path
"""
2020, nicholishen
Requires:
Python >= 3.6
pandas
openpyxl
chardet
pip install -U pandas ujson openpyxl chardet
def deep_attrdict(d: dict) -> AttrDict:
"""Uses recursion to dive deep into the dict
and convert all dict types to type AttrDict. This will
eliminate the bug where pulling a list of dicts
out of an AttrDict results in just a list of dicts.
"""
d = AttrDict(d)
for k, v in d.items():
if isinstance(v, dict):
d[k] = deep_attrdict(v)