Module python_gedcom_2.element.family

GEDCOM element consisting of tag gedcom.tags.GEDCOM_TAG_FAMILY

Expand source code
"""GEDCOM element consisting of tag `gedcom.tags.GEDCOM_TAG_FAMILY`"""

from python_gedcom_2.element.element import Element
import python_gedcom_2.tags


class NotAnActualFamilyError(Exception):
    pass


class FamilyElement(Element):

    def get_tag(self):
        return python_gedcom_2.tags.GEDCOM_TAG_FAMILY

    def has_children(self):
        """Returns whether or not there is at least one child in this family.
        :rtype: boolean
        """
        return self._is_tag_present(python_gedcom_2.tags.GEDCOM_TAG_CHILD)

Classes

class FamilyElement (level, pointer, tag, value, crlf='\n', multi_line=True)

GEDCOM element

Each line in a GEDCOM file is an element with the format

level [pointer] tag [value]

where level and tag are required, and pointer and value are optional. Elements are arranged hierarchically according to their level, and elements with a level of zero are at the top level. Elements with a level greater than zero are children of their parent.

A pointer has the format @pname@, where pname is any sequence of characters and numbers. The pointer identifies the object being pointed to, so that any pointer included as the value of any element points back to the original object. For example, an element may have a FAMS tag whose value is @F1@, meaning that this element points to the family record in which the associated person is a spouse. Likewise, an element with a tag of FAMC has a value that points to a family record in which the associated person is a child.

See a GEDCOM file for examples of tags and their values.

Tags available to an element are seen here: gedcom.tags

Expand source code
class FamilyElement(Element):

    def get_tag(self):
        return python_gedcom_2.tags.GEDCOM_TAG_FAMILY

    def has_children(self):
        """Returns whether or not there is at least one child in this family.
        :rtype: boolean
        """
        return self._is_tag_present(python_gedcom_2.tags.GEDCOM_TAG_CHILD)

Ancestors

Methods

def has_children(self)

Returns whether or not there is at least one child in this family. :rtype: boolean

Expand source code
def has_children(self):
    """Returns whether or not there is at least one child in this family.
    :rtype: boolean
    """
    return self._is_tag_present(python_gedcom_2.tags.GEDCOM_TAG_CHILD)

Inherited members

class NotAnActualFamilyError (*args, **kwargs)

Common base class for all non-exit exceptions.

Expand source code
class NotAnActualFamilyError(Exception):
    pass

Ancestors

  • builtins.Exception
  • builtins.BaseException