Simple access routines
Provide a simplified database access interface to the Gramps database.
Bases: object
Provide a simplified database access system. This system has been designed to ease the development of reports.
The user needs to take care when using this interface. Since it returns real objects instead of database references, it can consume a significant amount of memory if the user is not careful.
Example
A typical system of usage would be:
sa = SimpleAccess(database)
print "Person : ", sa.name(person)
print "Gender : ", sa.gender(person)
print "Birth date : ", sa.birth_date(person)
print "Birth place : ", sa.birth_place(person)
print "Death date : ", sa.death_date(person)
print "Death place : ", sa.death_place(person)
print "Father : ", sa.name(sa.father(person))
print "Mother : ", sa.name(sa.mother(person))
print "Spouse : ", sa.name(sa.spouse(person))
print "Marriage Type : ", sa.marriage_type(person)
print "Marriage Date : ", sa.marriage_date(person)
print "Marriage Place: ", sa.marriage_place(person)
for child in sa.children(person):
print "Child : ", sa.name(child)
# Print out burial and baptism events
for event in sa.events( person , [ "Burial", "Baptism" ]):
print "Event : ", sa.event_type(event), sa.event_date(event),
print sa.event_place(event)
This would produce an output that looks like:
Person : Garner, Lewis Anderson
Gender : male
Birth date : 6/21/1855
Birth place : Great Falls, MT
Death date : 6/28/1911
Death place : Twin Falls, ID
Father : Garner, Robert W.
Mother : Zielinski, Phoebe Emily
Spouse : Martel, Luella Jacques
Marriage Type : Married
Marriage Date : 4/1/1875
Marriage Place: Paragould, AR
Child : Garner, Eugene Stanley
Child : Garner, Jesse V.
Child : Garner, Raymond E.
Child : Garner, Jennie S.
Child : Garner, Walter E.
Child : Garner, Daniel Webster
Child : Garner, Bertha P.
Child : Garner, Elizabeth
Event : Burial 7/1/1911 Twin Falls, ID
One can also alternatively supply a handle rather than a person.
Return all the citations in the database, one at a time as an iterator. The user can treat this just like a list. For example:
:return: list of citations in the database
:rtype: list
Return all the events in the database, one at a time as an iterator. The user can treat this just like a list. For example:
for person in sa.all_events():
sa.print(sa.event_place(event))
Returns: | list of events in the database |
---|---|
Return type: | list |
Return all the families in the database, one at a time as an iterator. The user can treat this just like a list. For example:
for person in sa.all_families():
sa.print(sa.father(person))
Returns: | list of families in the database |
---|---|
Return type: | list |
Return all the media in the database, one at a time as an iterator. The user can treat this just like a list. For example:
:return: list of media in the database
:rtype: list
Return all the notes in the database, one at a time as an iterator. The user can treat this just like a list. For example:
:return: list of notes in the database
:rtype: list
Return a all the people in the database, one at a time as an iterator. The user can treat this just like a list. For example:
for person in sa.all_people():
sa.print(person)
Returns: | list of people in the database |
---|---|
Return type: | list |
Return all the places in the database, one at a time as an iterator. The user can treat this just like a list. For example:
:return: list of places in the database
:rtype: list
Return all the repositories in the database, one at a time as an iterator. The user can treat this just like a list. For example:
:return: list of repositories in the database
:rtype: list
Return all the sources in the database, one at a time as an iterator. The user can treat this just like a list. For example:
:return: list of sources in the database
:rtype: list
Return all the tags in the database, one at a time as an iterator. The user can treat this just like a list. For example:
:return: list of tags in the database
:rtype: list
Return the author of the source.
Parameters: | source (Source) – Source object |
---|---|
Returns: | author of the source |
Return type: | unicode |
Return a string indicating the date when the person’s birth.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns a string indicating the date when the person’s birth. |
Return type: | unicode |
Return the date when the person’s birth.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns the date when the person’s birth. |
Return type: | Date |
Return the date of the person’s birth or fallback event.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns the date when the person’s birth or fallback. |
Return type: | Date |
Return a string indicating the place of the person’s birth.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns a string indicating the place of the person’s birth. |
Return type: | unicode |
Return a list of families in which the person is listed as a child.
Parameters: | person (Person) – Person object |
---|---|
Returns: | list of Family objects in which the person is listed as a child. |
Return type: | list |
Return a list of the children as the children of the primary spouse.
Parameters: | obj (Person or Family) – Person or Family object |
---|---|
Returns: | Returns a list of Person objects representing the children |
Return type: | list |
Return a string representation a date_obj
Parameters: | date_obj (Date) – Date object |
---|---|
Returns: | Returns a string representation a date_obj |
Return type: | unicode |
Return a string indicating the date when the person’s death.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns a string indicating the date when the person’s death. |
Return type: | unicode |
Return the date when the person’s death.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns the date when the person’s death. |
Return type: | Date |
Return the date of the person’s death or fallback event.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns the date of the person’s death or fallback. |
Return type: | Date |
Return a string indicating the place of the person’s death.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns a string indicating the place of the person’s death. |
Return type: | unicode |
Given a object, return a string describing the object.
Given a object_class, prop, and value return a display string describing object.
Parameters: |
|
---|
Return a string indicating the date of the event
Parameters: | event (Event) – Event object |
---|---|
Returns: | Returns a string indicating the date of the event |
Return type: | unicode |
Return a string indicating the date of the event
Parameters: | event (Event) – Event object |
---|---|
Returns: | Returns a string indicating the date of the event |
Return type: | unicode |
Return a string indicating the place of the event
Parameters: | event (Event) – Event object |
---|---|
Returns: | Returns a string indicating the place of the event |
Return type: | unicode |
Return a string indicating the type of the event
Parameters: | event (Event) – Event object |
---|---|
Returns: | Returns a string indicating the type of the event |
Return type: | unicode |
Return a list of events associated with the object. This object can be either a Person or Family.
Parameters: | |
---|---|
Returns: | list of events associated with the object |
Return type: | list |
Return the primary father of the person or the father of the associated family.
Parameters: | obj (Person or Family) – Person or Family object |
---|---|
Returns: | The father in the person’s primary family or the father of the family |
Return type: | Person |
Return the first name of the person, or and empty string if the person is None
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns the first name of the person based of the program preferences |
Return type: | unicode |
Return a string representing the gender of the person
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns a string indentifying the person’s gender |
Return type: | unicode |
Given a object_class, prop, and value return the object.
Parameters: |
|
---|
Return the Gramps ID of the person or family
Parameters: | obj (Person or Family) – Person or Family object |
---|---|
Returns: | Returns the Gramps ID value of the person or family |
Return type: | unicode |
Return a string indicating the date when the person and his/her spouse where married.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns a string indicicating the date when the person and his/her spouse where married. |
Return type: | unicode |
Return a string describing the place where the person and his/her spouse where married.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns a string describing the place where the person and his/her spouse where married. |
Return type: | unicode |
Return a string describing the relationship between the person and his/per primary spouse.
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns a string describing the relationship between the person and his/per primary spouse. |
Return type: | unicode |
Returns the primary mother of the person or the mother of the associated family.
Parameters: | obj (Person or Family) – Person object |
---|---|
Returns: | The mother in the person’s primary family or the mother of the family |
Return type: | Person |
Return the name of the person, or and empty string if the person is None
Parameters: | person (Person) – Person object |
---|---|
Returns: | Returns the name of the person based of the program preferences |
Return type: | unicode |
Return the page of the citation.
Parameters: | citation (Citation) – Source object |
---|---|
Returns: | title of the citation |
Return type: | unicode |
Return a list of families in which the person is listed as a parent.
Parameters: | person (Person) – Person object |
---|---|
Returns: | list of Family objects in which the person is listed as a parent. |
Return type: | list |
Return a list of events associated with the object. This object can be either a Person or Family.
Parameters: | obj (Person or Family) – Person or Family |
---|---|
Returns: | list of events associated with the object |
Return type: | list |
Return the primary spouse of the person
Parameters: | person (Person) – Person object |
---|---|
Returns: | The spouse identified as the person’s primary spouse |
Return type: | Person |
Provide a simplified database access interface to the Gramps database.
Provide a simplified table creation interface
Bases: object
Provide a simplified table creation interface.
See if a column has formatting (if x and y are supplied) or see if a cell has formatting. If it does, return the formatted string, otherwise return data that is escaped (if that column has formatting), or just the plain data.