colander_data_converter.converters.stix2.converter
- class colander_data_converter.converters.stix2.converter.ColanderToStix2Mapper[source]
Bases:
Stix2Mapper
Maps Colander data to STIX2 data using the mapping file.
- convert_colander_relation(relation)[source]
Convert a Colander EntityRelation to a STIX2 relationship object.
- Parameters:
relation (
EntityRelation
) – The Colander EntityRelation to convert.- Returns:
- The converted STIX2 relationship object, or None if the relation cannot be
converted.
- Return type:
Optional[Dict[str, Any]]
- class colander_data_converter.converters.stix2.converter.Stix2Converter[source]
Bases:
object
Converter for STIX2 data to Colander data and vice versa. Uses the mapping file to convert between formats.
- static colander_to_stix2(colander_feed)[source]
Converts Colander data to STIX2 data using the mapping file.
- Parameters:
colander_feed (
colander_data_converter.base.models.ColanderFeed
) – The Colander data to convert.- Returns:
The converted STIX2 bundle.
- Return type:
- class colander_data_converter.converters.stix2.converter.Stix2Mapper[source]
Bases:
object
Base class for mapping between STIX2 and Colander data using the mapping file.
- class colander_data_converter.converters.stix2.converter.Stix2ToColanderMapper[source]
Bases:
Stix2Mapper
Maps STIX2 data to Colander data using the mapping file.
- convert(stix2_data)[source]
Convert STIX2 data to Colander data.
- Parameters:
stix2_data (
Dict[str
,Any]
) – The STIX2 data to convert.- Returns:
The converted Colander data.
- Return type:
- convert_stix2_object(stix2_object)[source]
Convert a STIX2 object to a Colander entity.
- Parameters:
stix2_object (
Dict[str
,Any]
) – The STIX2 object to convert.- Returns:
The converted Colander entity, or None if the object type is not supported.
- Return type:
Optional[Union[Actor, Device, Artifact, Observable, Threat, Event, DetectionRule, DataFragment, EntityRelation]]