typedparser 0.6.1__tar.gz → 0.6.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {typedparser-0.6.1 → typedparser-0.6.2}/PKG-INFO +1 -1
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser/__init__.py +1 -1
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser/objects.py +20 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser.egg-info/PKG-INFO +1 -1
- {typedparser-0.6.1 → typedparser-0.6.2}/LICENSE +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/README.md +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/pyproject.toml +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/requirements.txt +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/setup.cfg +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser/_typedattr.py +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser/_typedparser.py +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser/custom_format.py +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser/funcs.py +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser.egg-info/SOURCES.txt +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser.egg-info/dependency_links.txt +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser.egg-info/requires.txt +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser.egg-info/top_level.txt +0 -0
- {typedparser-0.6.1 → typedparser-0.6.2}/src/typedparser.egg-info/zip-safe +0 -0
|
@@ -312,3 +312,23 @@ def big_obj_to_short_str(d: Any) -> str:
|
|
|
312
312
|
return f"{class_name} len {len(d)}"
|
|
313
313
|
except TypeError:
|
|
314
314
|
return f"Object of type {class_name}"
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
def invert_dictionary(inv_dict: dict[str, dict[str, any]]) -> dict[str, dict[str, any]]:
|
|
318
|
+
"""
|
|
319
|
+
Invert a dictionary of dictionaries. Useful for creating dataframes.
|
|
320
|
+
|
|
321
|
+
Args:
|
|
322
|
+
inv_dict: dictionary of {key1: {field1: value1, field2: value2, ...}, ...}
|
|
323
|
+
|
|
324
|
+
Returns:
|
|
325
|
+
Dictionary of {field1: {key1: value1, key2: value2, ...}, ...}
|
|
326
|
+
|
|
327
|
+
"""
|
|
328
|
+
regular_dict = {}
|
|
329
|
+
for key, value_dict in inv_dict.items():
|
|
330
|
+
for field, value in value_dict.items():
|
|
331
|
+
if field not in regular_dict:
|
|
332
|
+
regular_dict[field] = {}
|
|
333
|
+
regular_dict[field][key] = value
|
|
334
|
+
return regular_dict
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|