diff --git a/stix2/utils.py b/stix2/utils.py index f23dbe2..960b89e 100644 --- a/stix2/utils.py +++ b/stix2/utils.py @@ -255,3 +255,6 @@ def get_class_hierarchy_names(obj): for cls in obj.__class__.__mro__: names.append(cls.__name__) return names + +def get_type_from_id(stix_id): + return stix_id.split('--', 1)[0]