| 29 | self.yesterday = (datetime.date.today() + datetime.timedelta(days=-1)).strftime("%Y%m%d") |
| 30 | |
| 31 | def parse_custom_string(self, input_str): |
| 32 | input_str = input_str.replace(' ', '').replace('\n', '').replace('"', '') |
| 33 | key_value_pattern = r"(\w+):\s*({.*?}|[^,{}]+)" |
| 34 | matches = re.findall(key_value_pattern, input_str) |
| 35 | |
| 36 | result = {} |
| 37 | for key, value in matches: |
| 38 | if value.startswith("{"): |
| 39 | result[key] = self.parse_custom_string(value) |
| 40 | else: |
| 41 | result[key] = value |
| 42 | return result |
| 43 | |
| 44 | def parse_json(self, input_str): |
| 45 | res = {} |