Skip to content

Instantly share code, notes, and snippets.

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)
"""
2020, nicholishen
Requires:
Python >= 3.6
pandas
openpyxl
chardet
pip install -U pandas ujson openpyxl chardet
"""
Install requirements
> pip install pandas openpyxl python-dateutil more-itertools pymt5adapter pytz
"""
import argparse
import datetime as dt
import math
from pathlib import Path
from pathlib import Path
import json
import asyncio
import aiofiles
import openai
from openai import AsyncOpenAI
import logging
# Configure logging
logging.basicConfig(