Module python_gedcom_2.element.object
GEDCOM element consisting of tag gedcom.tags.GEDCOM_TAG_OBJECT
Expand source code
"""GEDCOM element consisting of tag `gedcom.tags.GEDCOM_TAG_OBJECT`"""
from python_gedcom_2.element.element import Element
import python_gedcom_2.tags
class NotAnActualObjectError(Exception):
pass
class ObjectElement(Element):
def is_object(self):
"""Checks if this element is an actual object
:rtype: bool
"""
return self.get_tag() == python_gedcom_2.tags.GEDCOM_TAG_OBJECT
Classes
class NotAnActualObjectError (*args, **kwargs)-
Common base class for all non-exit exceptions.
Expand source code
class NotAnActualObjectError(Exception): passAncestors
- builtins.Exception
- builtins.BaseException
class ObjectElement (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
levelandtagare required, andpointerandvalueare 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@, wherepnameis 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 aFAMStag 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 ofFAMChas 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.tagsExpand source code
class ObjectElement(Element): def is_object(self): """Checks if this element is an actual object :rtype: bool """ return self.get_tag() == python_gedcom_2.tags.GEDCOM_TAG_OBJECTAncestors
Methods
def is_object(self)-
Checks if this element is an actual object :rtype: bool
Expand source code
def is_object(self): """Checks if this element is an actual object :rtype: bool """ return self.get_tag() == python_gedcom_2.tags.GEDCOM_TAG_OBJECT
Inherited members