HedTagEntry

class HedTagEntry(*args, **kwargs)[source]

A single tag entry in the HedSchema.

Methods

HedTagEntry.__init__(*args, **kwargs)

Constructor for HedSchemaEntry.

HedTagEntry.attribute_has_property(...)

Return True if attribute has property.

HedTagEntry.base_tag_has_attribute(tag_attribute)

Check if the base tag has a specific attribute.

HedTagEntry.finalize_entry(schema)

Called once after schema loading to set state.

HedTagEntry.has_attribute(attribute[, ...])

Returns th existence or value of an attribute in this entry.

Attributes

HedTagEntry.parent

Get the parent entry of this tag

HedTagEntry.parent_name

Gets the parent tag entry name

HedTagEntry.section_key

HedTagEntry.__init__(*args, **kwargs)[source]

Constructor for HedSchemaEntry.

Parameters:
  • name (str) – The name of the entry.

  • section (HedSchemaSection) – The section to which it belongs.

HedTagEntry.attribute_has_property(attribute, property_name)

Return True if attribute has property.

Parameters:
  • attribute (str) – Attribute name to check for property_name.

  • property_name (str) – The property value to return.

Returns:

Returns True if this entry has the property.

Return type:

bool

HedTagEntry.base_tag_has_attribute(tag_attribute)[source]

Check if the base tag has a specific attribute.

Parameters:

tag_attribute (str) – A tag attribute.

Returns:

True if the tag has the specified attribute. False, if otherwise.

Return type:

bool

Notes

This mostly is relevant for takes value tags.

HedTagEntry.finalize_entry(schema)[source]

Called once after schema loading to set state.

Parameters:

schema (HedSchema) – The schema that the rules come from.

HedTagEntry.has_attribute(attribute, return_value=False)[source]

Returns th existence or value of an attribute in this entry.

This also checks parent tags for inheritable attributes like ExtensionAllowed.

Parameters:
  • attribute (str) – The attribute to check for.

  • return_value (bool) – If True, returns the actual value of the attribute. If False, returns a boolean indicating the presence of the attribute.

Returns:

If return_value is False, returns True if the attribute exists and False otherwise. If return_value is True, returns the value of the attribute if it exists, else returns None.

Return type:

bool or any

Notes

  • The existence of an attribute does not guarantee its validity.

HedTagEntry.parent

Get the parent entry of this tag

HedTagEntry.parent_name

Gets the parent tag entry name

HedTagEntry.section_key