The gramps.gen.proxy Module

Proxy Base

Proxy class for the Gramps databases. Filter out all data marked private.

class gramps.gen.proxy.proxybase.ProxyCursor(get_raw, get_handles)[source]

Bases: object

A cursor for moving through proxied data.

class gramps.gen.proxy.proxybase.ProxyDbBase(db)[source]

Bases: gramps.gen.db.base.DbReadBase

ProxyDbBase is a base class for building a proxy to a Gramps database. This class attempts to implement functions that are likely to be common among proxy classes. Functions that are not likely to be common raise a NotImplementedError to remind the developer to implement those functions.

Real database proxy classes can inherit from this class to make sure the database interface is properly implemented.

close()[source]

Close on a proxy closes real database.

find_initial_person()[source]

Find an initial person, given that they might not be available.

get_bookmarks()[source]

returns the list of Person handles in the bookmarks

get_child_reference_types()[source]

returns a list of all child reference types associated with Family instances in the database

get_citation_bookmarks()[source]

returns the list of Citation handles in the bookmarks

get_citation_cursor()[source]
get_citation_from_gramps_id(val)[source]

Finds a Citation in the database from the passed gramps’ ID. If no such Citation exists, None is returned.

get_citation_from_handle(handle)[source]

Finds a Citation in the database from the passed gramps handle. If no such Citation exists, None is returned.

get_citation_handles(sort_handles=False)[source]

Return a list of database handles, one handle for each Citation in the database.

get_dbid()[source]

Return the database ID.

get_default_handle()[source]

returns the default Person of the database

get_default_person()[source]

returns the default Person of the database

get_event_attribute_types()[source]

returns a list of all Attribute types associated with Event instances in the database

get_event_bookmarks()[source]

returns the list of Event handles in the bookmarks

get_event_cursor()[source]
get_event_from_gramps_id(val)[source]

Finds an Event in the database from the passed GRAMPS ID. If no such Event exists, None is returned.

get_event_from_handle(handle)[source]

Finds a Event in the database from the passed gramps handle. If no such Event exists, None is returned.

get_event_handles(sort_handles=True)[source]

Return a list of database handles, one handle for each Event in the database.

get_event_roles()[source]

returns a list of all custom event role names associated with Event instances in the database

get_event_types()[source]

returns a list of all event types in the database

get_family_attribute_types()[source]

returns a list of all Attribute types associated with Family instances in the database

get_family_bookmarks()[source]

returns the list of Family handles in the bookmarks

get_family_cursor()[source]
get_family_event_types()[source]

Deprecated: Use get_event_types

get_family_from_gramps_id(val)[source]

Finds a Family in the database from the passed GRAMPS ID. If no such Family exists, None is returned.

get_family_from_handle(handle)[source]

Finds a Family in the database from the passed gramps handle. If no such Family exists, None is returned.

get_family_handles(sort_handles=True)[source]

Return a list of database handles, one handle for each Family in the database.

get_family_relation_types()[source]

returns a list of all relationship types associated with Family instances in the database

get_gramps_ids(obj_key)[source]
get_media_attribute_types()[source]

returns a list of all Attribute types associated with Media and MediaRef instances in the database

get_media_bookmarks()[source]

returns the list of Media handles in the bookmarks

get_media_cursor()[source]
get_media_object_handles(sort_handles=False)[source]

Return a list of database handles, one handle for each MediaObject in the database.

get_mediapath()[source]

returns the default media path of the database

get_name_group_keys()[source]

Return the defined names that have been assigned to a default grouping

get_name_group_mapping(surname)[source]

Return the default grouping name for a surname

get_name_types()[source]

returns a list of all custom names types associated with Person instances in the database

get_note_bookmarks()[source]

returns the list of Note handles in the bookmarks

get_note_cursor()[source]
get_note_from_gramps_id(val)[source]

Finds a Note in the database from the passed gramps’ ID. If no such Note exists, None is returned.

get_note_from_handle(handle)[source]

Finds a Note in the database from the passed gramps handle. If no such Note exists, None is returned.

get_note_handles(sort_handles=True)[source]

Return a list of database handles, one handle for each Note in the database.

get_note_types()[source]

returns a list of all custom note types associated with Note instances in the database

get_number_of_citations()[source]

Return the number of Citations currently in the database.

get_number_of_events()[source]

Return the number of events currently in the database.

get_number_of_families()[source]

Return the number of families currently in the database.

get_number_of_media_objects()[source]

Return the number of media objects currently in the database.

get_number_of_notes()[source]

Return the number of notes currently in the database.

get_number_of_people()[source]

Return the number of people currently in the database.

get_number_of_places()[source]

Return the number of places currently in the database.

get_number_of_repositories()[source]

Return the number of source repositories currently in the database.

get_number_of_sources()[source]

Return the number of sources currently in the database.

get_number_of_tags()[source]

Return the number of tags currently in the database.

get_object_from_gramps_id(val)[source]

Finds a MediaObject in the database from the passed gramps’ ID. If no such MediaObject exists, None is returned.

get_object_from_handle(handle)[source]

Finds an Object in the database from the passed gramps handle. If no such Object exists, None is returned.

get_origin_types()[source]

returns a list of all custom origin types associated with Person/Surname instances in the database

get_person_attribute_types()[source]

returns a list of all Attribute types associated with Person instances in the database

get_person_cursor()[source]
get_person_event_types()[source]

Deprecated: Use get_event_types

get_person_from_gramps_id(val)[source]

Finds a Person in the database from the passed GRAMPS ID. If no such Person exists, None is returned.

get_person_from_handle(handle)[source]

Finds a Person in the database from the passed gramps handle. If no such Person exists, None is returned.

get_person_handles(sort_handles=False)[source]

Return a list of database handles, one handle for each Person in the database.

get_place_bookmarks()[source]

returns the list of Place handles in the bookmarks

get_place_cursor()[source]
get_place_from_gramps_id(val)[source]

Finds a Place in the database from the passed gramps’ ID. If no such Place exists, None is returned.

get_place_from_handle(handle)[source]

Finds a Place in the database from the passed gramps handle. If no such Place exists, None is returned.

get_place_handles(sort_handles=False)[source]

Return a list of database handles, one handle for each Place in the database.

get_raw_citation_data(handle)[source]
get_raw_event_data(handle)[source]
get_raw_family_data(handle)[source]
get_raw_note_data(handle)[source]
get_raw_object_data(handle)[source]
get_raw_person_data(handle)[source]
get_raw_place_data(handle)[source]
get_raw_repository_data(handle)[source]
get_raw_source_data(handle)[source]
get_raw_tag_data(handle)[source]
get_repo_bookmarks()[source]

returns the list of Repository handles in the bookmarks

get_repository_cursor()[source]
get_repository_from_gramps_id(val)[source]

Finds a Repository in the database from the passed gramps’ ID. If no such Repository exists, None is returned.

get_repository_from_handle(handle)[source]

Finds a Repository in the database from the passed gramps handle. If no such Repository exists, None is returned.

get_repository_handles(sort_handles=True)[source]

Return a list of database handles, one handle for each Repository in the database.

get_repository_types()[source]

returns a list of all custom repository types associated with Repository instances in the database

get_researcher()[source]

returns the Researcher instance, providing information about the owner of the database

get_save_path()[source]

returns the save path of the file, or “” if one does not exist

get_source_attribute_types()[source]

returns a list of all Attribute types associated with Source/Citation instances in the database

get_source_bookmarks()[source]

returns the list of Source handles in the bookmarks

get_source_cursor()[source]
get_source_from_gramps_id(val)[source]

Finds a Source in the database from the passed gramps’ ID. If no such Source exists, None is returned.

get_source_from_handle(handle)[source]

Finds a Source in the database from the passed gramps handle. If no such Source exists, None is returned.

get_source_handles(sort_handles=False)[source]

Return a list of database handles, one handle for each Source in the database.

get_source_media_types()[source]

returns a list of all custom source media types associated with Source instances in the database

get_tag_cursor()[source]
get_tag_from_handle(handle)[source]

Finds a Tag in the database from the passed gramps handle. If no such Tag exists, None is returned.

get_tag_from_name(val)[source]

Finds a Tag in the database from the passed tag name. If no such Tag exists, None is returned.

get_tag_handles(sort_handles=False)[source]

Return a list of database handles, one handle for each Tag in the database.

get_url_types()[source]

returns a list of all custom names types associated with Url instances in the database

static gfilter(predicate, obj)[source]

Returns obj if predicate is True or not callable, else returns None

has_citation_handle(handle)[source]

returns True if the handle exists in the current Citation database.

has_event_handle(handle)[source]

returns True if the handle exists in the current Event database.

has_family_handle(handle)[source]

Returns True if the handle exists in the current Family database.

has_gramps_id(obj_key, gramps_id)[source]
has_name_group_key(name)[source]

Return if a key exists in the name_group table

has_note_handle(handle)[source]

returns True if the handle exists in the current Note database.

has_object_handle(handle)[source]

returns True if the handle exists in the current MediaObjectdatabase.

has_person_handle(handle)[source]

Returns True if the handle exists in the current Person database.

has_place_handle(handle)[source]

returns True if the handle exists in the current Place database.

has_repository_handle(handle)[source]

returns True if the handle exists in the current Repository database.

has_source_handle(handle)[source]

returns True if the handle exists in the current Source database.

has_tag_handle(handle)[source]

returns True if the handle exists in the current Tag database.

include_citation = None
include_event = None
include_family = None
include_media_object = None
include_note = None
include_person = None
include_place = None
include_repository = None
include_something(handle, obj=None)[source]

Model predicate. Returns True if object referred to by handle is to be included, otherwise returns False.

include_source = None
include_tag = None
is_open()[source]

Return 1 if the database has been opened.

iter_citation_handles()[source]

Return an iterator over database handles, one handle for each Citation in the database.

iter_citations()[source]

Return an iterator over Citation objects in the database

iter_event_handles()[source]

Return an iterator over database handles, one handle for each Event in the database.

iter_events()[source]

Return an iterator over Event objects in the database

iter_families()[source]

Return an iterator over Family objects in the database

iter_family_handles()[source]

Return an iterator over database handles, one handle for each Family in the database.

iter_media_object_handles()[source]

Return an iterator over database handles, one handle for each Media Object in the database.

iter_media_objects()[source]

Return an iterator over Media objects in the database

iter_note_handles()[source]

Return an iterator over database handles, one handle for each Note in the database.

iter_notes()[source]

Return an iterator over Note objects in the database

iter_people()[source]

Return an iterator over Person objects in the database

iter_person_handles()[source]

Return an iterator over database handles, one handle for each Person in the database.

iter_place_handles()[source]

Return an iterator over database handles, one handle for each Place in the database.

iter_places()[source]

Return an iterator over Place objects in the database

iter_repositories()[source]

Return an iterator over Repositories objects in the database

iter_repository_handles()[source]

Return an iterator over database handles, one handle for each Repository in the database.

iter_source_handles()[source]

Return an iterator over database handles, one handle for each Source in the database.

iter_sources()[source]

Return an iterator over Source objects in the database

iter_tag_handles()[source]

Return an iterator over database handles, one handle for each Tag in the database.

iter_tags()[source]

Return an iterator over Tag objects in the database

class gramps.gen.proxy.proxybase.ProxyMap(db, get_raw, get_keys)[source]

Bases: object

A dictionary-like object for accessing “raw” proxied data. Of course, proxied data may have been changed by the proxy.

keys()[source]

Filter

Proxy class for the Gramps databases. Apply filter

class gramps.gen.proxy.filter.FilterProxyDb(db, person_filter=None, event_filter=None, note_filter=None)[source]

Bases: gramps.gen.proxy.proxybase.ProxyDbBase

A proxy to a Gramps database. This proxy will act like a Gramps database, but all data that does not match the provided filters will be hidden from the user.

Find all objects that hold a reference to the object handle. Returns an iterator over a list of (class_name, handle) tuples.

Parameters:
  • handle (database handle) – handle of the object to search for.
  • include_classes (list of class names) – list of class names to include in the results. Default: None means include all classes.

This default implementation does a sequential scan through all the primary object databases and is very slow. Backends can override this method to provide much faster implementations that make use of additional capabilities of the backend.

Note that this is a generator function, it returns a iterator for use in loops. If you want a list of the results use:

>    result_list = list(find_backlink_handles(handle))
get_citation_from_gramps_id(val)[source]

Finds a Citation in the database from the passed Gramps ID. If no such Citation exists, None is returned.

get_citation_from_handle(handle)[source]

Finds a Citation in the database from the passed Gramps ID. If no such Citation exists, None is returned.

get_default_handle()[source]

returns the default Person of the database

get_default_person()[source]

returns the default Person of the database

get_event_from_gramps_id(val)[source]

Finds an Event in the database from the passed Gramps ID. If no such Event exists, None is returned.

get_event_from_handle(handle)[source]

Finds a Event in the database from the passed Gramps ID. If no such Event exists, None is returned.

get_event_handles()[source]

Return a list of database handles, one handle for each Event in the database.

get_family_from_gramps_id(val)[source]

Finds a Family in the database from the passed Gramps ID. If no such Family exists, None is returned.

get_family_from_handle(handle)[source]

Finds a Family in the database from the passed Gramps ID. If no such Family exists, None is returned.

get_family_handles()[source]

Return a list of database handles, one handle for each Family in the database.

get_note_from_gramps_id(val)[source]

Finds a Note in the database from the passed Gramps ID. If no such Note exists, None is returned.

get_note_from_handle(handle)[source]

Finds a Note in the database from the passed Gramps ID. If no such Note exists, None is returned.

get_note_handles()[source]

Return a list of database handles, one handle for each Note in the database.

get_object_from_gramps_id(val)[source]

Finds a MediaObject in the database from the passed Gramps ID. If no such MediaObject exists, None is returned.

get_object_from_handle(handle)[source]

Finds a MediaObject in the database from the passed Gramps handle. If no such Object exists, None is returned.

get_person_from_gramps_id(val)[source]

Finds a Person in the database from the passed Gramps ID. If no such Person exists, None is returned.

get_person_from_handle(handle)[source]

Finds a Person in the database from the passed Gramps ID. If no such Person exists, None is returned.

get_person_handles(sort_handles=False)[source]

Return a list of database handles, one handle for each Person in the database. If sort_handles is True, the list is sorted by surnames

get_place_from_gramps_id(val)[source]

Finds a Place in the database from the passed Gramps ID. If no such Place exists, None is returned.

get_place_from_handle(handle)[source]

Finds a Place in the database from the passed Gramps handle. If no such Place exists, None is returned.

get_repository_from_gramps_id(val)[source]

Finds a Repository in the database from the passed Gramps ID. If no such Repository exists, None is returned.

get_repository_from_handle(handle)[source]

Finds a Repository in the database from the passed Gramps ID. If no such Repository exists, None is returned.

get_source_from_gramps_id(val)[source]

Finds a Source in the database from the passed Gramps ID. If no such Source exists, None is returned.

get_source_from_handle(handle)[source]

Finds a Source in the database from the passed Gramps ID. If no such Source exists, None is returned.

has_event_handle(handle)[source]

returns True if the handle exists in the current Event database.

has_family_handle(handle)[source]

returns True if the handle exists in the current Family database.

has_note_handle(handle)[source]

returns True if the handle exists in the current Note database.

has_person_handle(handle)[source]

returns True if the handle exists in the current Person database.

include_event(handle)[source]
include_family(handle)[source]
include_note(handle)[source]
include_person(handle)[source]
iter_event_handles()[source]

Return an iterator over database handles, one handle for each Event in the database.

iter_events()[source]

Return an iterator over objects for Events in the database

iter_families()[source]

Return an iterator over objects for Families in the database

iter_family_handles()[source]

Return an iterator over database handles, one handle for each Family in the database.

iter_note_handles()[source]

Return an iterator over database handles, one handle for each Note in the database.

iter_notes()[source]

Return an iterator over objects for Notes in the database

iter_people()[source]

Return an iterator over objects for Persons in the database

iter_person_handles()[source]

Return an iterator over database handles, one handle for each Person in the database.

sanitize_addressbase(addressbase)[source]
sanitize_notebase(notebase)[source]

Filters notes out of the passed notebase object according to the Note Filter.

Parameters:notebase – NoteBase object to clean
sanitize_person(person)[source]

Cleans filtered notes out of the passed person

Parameters:event (Person) – Person object to clean

Living

Proxy class for the Gramps databases. Filter out all living people.

class gramps.gen.proxy.living.LivingProxyDb(dbase, mode, current_year=None, years_after_death=0)[source]

Bases: gramps.gen.proxy.proxybase.ProxyDbBase

A proxy to a Gramps database. This proxy will act like a Gramps database, but all living people will be hidden from the user.

MODE_EXCLUDE_ALL = 0
MODE_INCLUDE_FULL_NAME_ONLY = 2
MODE_INCLUDE_LAST_NAME_ONLY = 1

Find all objects that hold a reference to the object handle. Returns an iterator over a list of (class_name, handle) tuples.

Parameters:
  • handle (database handle) – handle of the object to search for.
  • include_classes (list of class names) – list of class names to include in the results. Default: None means include all classes.

This default implementation does a sequential scan through all the primary object databases and is very slow. Backends can override this method to provide much faster implementations that make use of additional capabilities of the backend.

Note that this is a generator function, it returns a iterator for use in loops. If you want a list of the results use:

>    result_list = list(find_backlink_handles(handle))
get_default_handle()[source]

returns the default Person of the database

get_default_person()[source]

returns the default Person of the database

get_family_from_gramps_id(val)[source]

Finds a Family in the database from the passed Gramps ID. If no such Family exists, None is returned.

get_family_from_handle(handle)[source]

Finds a Family in the database from the passed handle. If no such Family exists, None is returned.

get_person_from_gramps_id(val)[source]

Finds a Person in the database from the passed Gramps ID. If no such Person exists, None is returned.

get_person_from_handle(handle)[source]

Finds a Person in the database from the passed Gramps ID. If no such Person exists, None is returned.

has_person_handle(handle)[source]

returns True if the handle exists in the current Person database.

include_person(handle)[source]
iter_people()[source]

Protected version of iter_people

Private

Proxy class for the Gramps databases. Filter out all data marked private.

class gramps.gen.proxy.private.PrivateProxyDb(db)[source]

Bases: gramps.gen.proxy.proxybase.ProxyDbBase

A proxy to a Gramps database. This proxy will act like a Gramps database, but all data marked private will be hidden from the user.

Find all objects that hold a reference to the object handle. Returns an iterator over a list of (class_name, handle) tuples.

Parameters:
  • handle (database handle) – handle of the object to search for.
  • include_classes (list of class names) – list of class names to include in the results. Default: None means include all classes.

This default implementation does a sequential scan through all the primary object databases and is very slow. Backends can override this method to provide much faster implementations that make use of additional capabilities of the backend.

Note that this is a generator function, it returns a iterator for use in loops. If you want a list of the results use:

>    result_list = list(find_backlink_handles(handle))
get_citation_from_gramps_id(val)[source]

Finds a Citation in the database from the passed Gramps ID. If no such Citation exists, None is returned.

get_citation_from_handle(handle)[source]

Finds a Citation in the database from the passed Gramps ID. If no such Citation exists, None is returned.

get_default_handle()[source]

returns the default Person of the database

get_default_person()[source]

returns the default Person of the database

get_event_from_gramps_id(val)[source]

Finds an Event in the database from the passed GRAMPS ID. If no such Event exists, None is returned.

get_event_from_handle(handle)[source]

Finds a Event in the database from the passed Gramps ID. If no such Event exists, None is returned.

get_family_from_gramps_id(val)[source]

Finds a Family in the database from the passed GRAMPS ID. If no such Family exists, None is returned.

get_family_from_handle(handle)[source]

Finds a Family in the database from the passed Gramps ID. If no such Family exists, None is returned.

get_note_from_gramps_id(val)[source]

Finds a Note in the database from the passed Gramps ID. If no such Note exists, None is returned.

get_note_from_handle(handle)[source]

Finds a Note in the database from the passed Gramps ID. If no such Note exists, None is returned.

get_object_from_gramps_id(val)[source]

Finds a MediaObject in the database from the passed Gramps ID. If no such MediaObject exists, None is returned.

get_object_from_handle(handle)[source]

Finds an Object in the database from the passed Gramps ID. If no such Object exists, None is returned.

get_person_from_gramps_id(val)[source]

Finds a Person in the database from the passed GRAMPS ID. If no such Person exists, None is returned.

get_person_from_handle(handle)[source]

Finds a Person in the database from the passed Gramps ID. If no such Person exists, None is returned.

get_place_from_gramps_id(val)[source]

Finds a Place in the database from the passed Gramps ID. If no such Place exists, None is returned.

get_place_from_handle(handle)[source]

Finds a Place in the database from the passed Gramps ID. If no such Place exists, None is returned.

get_repository_from_gramps_id(val)[source]

Finds a Repository in the database from the passed Gramps ID. If no such Repository exists, None is returned.

get_repository_from_handle(handle)[source]

Finds a Repository in the database from the passed Gramps ID. If no such Repository exists, None is returned.

get_source_from_gramps_id(val)[source]

Finds a Source in the database from the passed Gramps ID. If no such Source exists, None is returned.

get_source_from_handle(handle)[source]

Finds a Source in the database from the passed Gramps ID. If no such Source exists, None is returned.

has_citation_handle(handle)[source]

returns True if the handle exists in the current Citation database.

has_event_handle(handle)[source]

returns True if the handle exists in the current Event database.

has_family_handle(handle)[source]

Return True if the handle exists in the current Family database.

has_note_handle(handle)[source]

Return True if the handle exists in the current Note database.

has_object_handle(handle)[source]

Return True if the handle exists in the current MediaObjectdatabase.

has_person_handle(handle)[source]

returns True if the handle exists in the current Person database.

has_place_handle(handle)[source]

returns True if the handle exists in the current Place database.

has_repository_handle(handle)[source]

Return True if the handle exists in the current Repository database.

has_source_handle(handle)[source]

returns True if the handle exists in the current Source database.

include_citation(handle)[source]

Predicate returning True if object is to be included, else False

include_event(handle)[source]

Predicate returning True if object is to be included, else False

include_family(handle)[source]

Predicate returning True if object is to be included, else False

include_media_object(handle)[source]

Predicate returning True if object is to be included, else False

include_note(handle)[source]

Predicate returning True if object is to be included, else False

include_person(handle)[source]

Predicate returning True if object is to be included, else False

include_place(handle)[source]

Predicate returning True if object is to be included, else False

include_repository(handle)[source]

Predicate returning True if object is to be included, else False

include_source(handle)[source]

Predicate returning True if object is to be included, else False

gramps.gen.proxy.private.copy_addresses(db, original_obj, clean_obj)[source]

Copies addresses from one object to another - excluding references to private addresses.

Parameters:
  • db (DbBase) – Gramps database to which the references belongs
  • original_obj (AddressBase) – Object that may have addresses
  • clean_obj – Object that will have only non-private addresses
Returns:

Nothing

gramps.gen.proxy.private.copy_associations(db, original_obj, clean_obj)[source]

Copies associations from one object to another - excluding references to private notes.

Parameters:
  • db (DbBase) – Gramps database to which the references belongs
  • original_obj (Base) – Object that may have private references
  • clean_obj – Object that will have only non-private references
Returns:

Nothing

gramps.gen.proxy.private.copy_attributes(db, original_obj, clean_obj)[source]

Copies attributes from one object to another - excluding references to private attributes.

Parameters:
  • db (DbBase) – Gramps database to which the references belongs
  • original_obj (AttributeBase) – Object that may have private references
  • clean_obj – Object that will have only non-private references
Returns:

Nothing

gramps.gen.proxy.private.copy_citation_ref_list(db, original_obj, clean_obj)[source]

Copies citation references from one object to another - excluding references to private citations, and references to citations that refer to private sources.

Parameters:
  • db (DbBase) – Gramps database to which the references belongs
  • original_obj (CitationBase) – Object that may have private references
  • clean_obj – Object that will have only non-private references
Returns:

Nothing

gramps.gen.proxy.private.copy_lds_ords(db, original_obj, clean_obj)[source]

Copies LDS ORDs from one object to another - excluding references to private LDS ORDs.

Parameters:
  • db (DbBase) – Gramps database to which the references belongs
  • original_obj (LdsOrdBase) – Object that may have LDS ORDs
  • clean_obj – Object that will have only non-private LDS ORDs
Returns:

Nothing

gramps.gen.proxy.private.copy_media_ref_list(db, original_obj, clean_obj)[source]

Copies media references from one object to another - excluding private references and references to private objects.

Parameters:
  • db (DbBase) – Gramps database to which the references belongs
  • original_obj (MediaBase) – Object that may have private references
  • clean_obj – Object that will have only non-private references
Returns:

Nothing

gramps.gen.proxy.private.copy_notes(db, original_obj, clean_obj)[source]

Copies notes from one object to another - excluding references to private notes.

Parameters:
  • db (DbBase) – Gramps database to which the references belongs
  • original_obj (NoteBase) – Object that may have private references
  • clean_obj – Object that will have only non-private references
Returns:

Nothing

gramps.gen.proxy.private.copy_srcattributes(db, original_obj, clean_obj)[source]

Copies srcattributes from one object to another - excluding references to private srcattributes.

Parameters:
  • db (DbBase) – Gramps database to which the references belongs
  • original_obj (SrcAttributeBase) – Object that may have private references
  • clean_obj – Object that will have only non-private references
Returns:

Nothing

gramps.gen.proxy.private.copy_urls(db, original_obj, clean_obj)[source]

Copies urls from one object to another - excluding references to private urls.

Parameters:
  • db (DbBase) – Gramps database to which the references belongs
  • original_obj (UrlBase) – Object that may have urls
  • clean_obj – Object that will have only non-private urls
Returns:

Nothing

gramps.gen.proxy.private.sanitize_address(db, address)[source]

Create a new Address instance based off the passed Address instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • name (Address) – source Address object that will be copied with privacy records removed
Returns:

‘cleansed’ Address object

Return type:

Address

gramps.gen.proxy.private.sanitize_citation(db, citation)[source]

Create a new Citation instance based off the passed Citation instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • citation (Citation) – source Citation object that will be copied with privacy records removed
Returns:

‘cleansed’ Citation object

Return type:

Citation

gramps.gen.proxy.private.sanitize_event(db, event)[source]

Create a new Event instance based off the passed Event instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • event (Event) – source Event object that will be copied with privacy records removed
Returns:

‘cleansed’ Event object

Return type:

Event

gramps.gen.proxy.private.sanitize_event_ref(db, event_ref)[source]

Create a new EventRef instance based off the passed EventRef instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • event_ref (EventRef) – source EventRef object that will be copied with privacy records removed
Returns:

‘cleansed’ EventRef object

Return type:

EventRef

gramps.gen.proxy.private.sanitize_family(db, family)[source]

Create a new Family instance based off the passed Family instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • family (Family) – source Family object that will be copied with privacy records removed
Returns:

‘cleansed’ Family object

Return type:

Family

gramps.gen.proxy.private.sanitize_lds_ord(db, lds_ord)[source]

Create a new LdsOrd instance based off the passed LdsOrd instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the LdsOrd object belongs
  • name (LdsOrd) – source LdsOrd object that will be copied with privacy records removed
Returns:

‘cleansed’ LdsOrd object

Return type:

LdsOrd

gramps.gen.proxy.private.sanitize_media(db, media)[source]

Create a new MediaObject instance based off the passed Media instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • media (MediaObject) – source Media object that will be copied with privacy records removed
Returns:

‘cleansed’ Media object

Return type:

MediaObject

gramps.gen.proxy.private.sanitize_media_ref(db, media_ref)[source]

Create a new MediaRef instance based off the passed MediaRef instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the MediaRef object belongs
  • source_ref (MediaRef) – source MediaRef object that will be copied with privacy records removed
Returns:

‘cleansed’ MediaRef object

Return type:

MediaRef

gramps.gen.proxy.private.sanitize_name(db, name)[source]

Create a new Name instance based off the passed Name instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • name (Name) – source Name object that will be copied with privacy records removed
Returns:

‘cleansed’ Name object

Return type:

Name

gramps.gen.proxy.private.sanitize_person(db, person)[source]

Create a new Person instance based off the passed Person instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • person (Person) – source Person object that will be copied with privacy records removed
Returns:

‘cleansed’ Person object

Return type:

Person

gramps.gen.proxy.private.sanitize_place(db, place)[source]

Create a new Place instance based off the passed Place instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • place (Place) – source Place object that will be copied with privacy records removed
Returns:

‘cleansed’ Place object

Return type:

Place

gramps.gen.proxy.private.sanitize_repository(db, repository)[source]

Create a new Repository instance based off the passed Repository instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • repository (Repository) – source Repository object that will be copied with privacy records removed
Returns:

‘cleansed’ Repository object

Return type:

Repository

gramps.gen.proxy.private.sanitize_source(db, source)[source]

Create a new Source instance based off the passed Source instance. The returned instance has all private records removed from it.

Parameters:
  • db (DbBase) – Gramps database to which the Person object belongs
  • source (Source) – source Source object that will be copied with privacy records removed
Returns:

‘cleansed’ Source object

Return type:

Source

References

Proxy class for the Gramps databases. Returns objects which are referenced by a person, or through a chain of references starting with a person.

class gramps.gen.proxy.referencedbyselection.ReferencedBySelectionProxyDb(dbase, all_people=False)[source]

Bases: gramps.gen.proxy.proxybase.ProxyDbBase

A proxy to a Gramps database. This proxy will act like a Gramps database, but returning all objects which are referenced by a selection, or by an object that is referenced by an object which is eventually referenced by one of the selected objects.

Return appropriate backlink handles for this proxy.

include_citation(handle)[source]

Filter for citations

include_event(handle)[source]

Filter for events

include_family(handle)[source]

Filter for families

include_media_object(handle)[source]

Filter for media objects

include_note(handle)[source]

Filter for notes

include_person(handle)[source]

Filter for person

include_place(handle)[source]

Filter for places

include_repository(handle)[source]

Filter for repositories

include_source(handle)[source]

Filter for sources

include_tag(handle)[source]

Filter for tags

process_address(address)[source]

Find all of the primary objects referred to

process_addresses(original_obj)[source]

Find all of the primary objects referred to

process_associations(original_obj)[source]

Find all of the primary objects referred to

process_attributes(original_obj)[source]

Find all of the primary objects referred to

process_citation(citation)[source]

Follow the citation object and find all of the primary objects that it references.

process_citation_ref_list(original_obj)[source]

Find all of the primary objects referred to

process_event(event)[source]

Follow the event object and find all of the primary objects that it references.

process_event_ref(event_ref)[source]

Find all of the primary objects referred to

process_family(family)[source]

Follow the family object and find all of the primary objects that it references.

process_lds_ord(lds_ord)[source]

Find all of the primary objects referred to

process_lds_ords(original_obj)[source]

Find all of the primary objects referred to

process_media(media)[source]

Follow the media object and find all of the primary objects that it references.

process_media_ref_list(original_obj)[source]

Find all of the primary objects referred to

process_name(name)[source]

Find all of the primary objects referred to

process_note(note)[source]

Follow the note object and find all of the primary objects that it references.

process_notes(original_obj)[source]

Find all of the primary objects referred to

process_object(class_name, handle, reference=True)[source]
process_person(person, reference=True)[source]

Follow the person object and find all of the primary objects that it references.

process_place(place)[source]

Follow the place object and find all of the primary objects that it references.

process_repository(repository)[source]

Follow the repository object and find all of the primary objects that it references.

process_source(source)[source]

Follow the source object and find all of the primary objects that it references.

process_tags(original_obj)[source]

Record the tags referenced by the primary object.

process_urls(original_obj)[source]

Find all of the primary objects referred to

queue_object(obj_type, handle, reference=True)[source]
reset_references()[source]

Table Of Contents

Previous topic

The gramps.gen.plug Module

Next topic

The gramps.gen.utils Module

This Page