maec Module


class maec.Entity

Bases: mixbox.entities.Entity

Base class for all classes in the MAEC SimpleAPI.

to_xml_file(file, namespace_dict=None, custom_header=None)

Export an object to an XML file. Only supports Package or Bundle objects at the moment.

  • file – the name of a file or a file-like object to write the output to.
  • namespace_dict – a dictionary of mappings of additional XML namespaces to prefixes.
  • custom_header – a string, list, or dictionary that represents a custom XML header to be written to the output.
class maec.EntityList(*args)[source]

Bases: _abcoll.MutableSequence, mixbox.entities.Entity

An EntityList is an Entity that behaves like a mutable sequence.

EntityList implementations must define one multiple TypedField which has an Entity subclass type. EntityLists can define other TypedFields that are not multiple.

The MutableSequence methods are used to interact with the multiple TypedField.

classmethod list_from_object(entitylist_obj)[source]

Convert from object representation to list representation.

classmethod object_from_list(entitylist_list)[source]

Convert from list representation to object representation.