Census Addons

From Gramps
Jump to: navigation, search

Please use carefully on data that is backed up, and help make it better by reporting any comments or problems to the author, or issues to the bug tracker
Unless otherwise stated on this page, you can download this addon by following these instructions.
Please note that some Addons have prerequisites that need to be installed before they can be used.
This Addon/Plugin system is controlled by the Plugin Manager.

No longer supported

The Census Addons have been replaced in Gramps 4.2.X by the Forms Gramplet addon

There are two census addons: a gramplet and a report.

The gramplet allows users to create and edit census data in a single form.

The report prints census events in a format similar to the original census entries.


Before using the census addons you need to define which of your sources are census sources.

To do this you need to edit each source and add an entry in the Attributes tab. The entry must have a key of "Census" and a value which is a code that identifies the census.

Prior to v4.1, use the Data tab. After typing the value code you must press "Enter" before clicking "OK", or the value will not be saved.

Translated Gramps

If you are using a Gramps in other language than english, type the value key in translated form. E.g. in finnish "Väestönlaskenta".


Supported definitions

A number of supported definitions are included with the download.

A full list of codes is available. See: Census Definitions

Writing your own definitions

If a census you require is not in the list of supported definitions then you can write your own.

Census defintions are stored in a XML files. These are located in the Census directory beneath your plugins directory. The file called census.xml, provided in the download, contains some common definitions. Additional files called custom.xml and test.xml will also be searched.

Definition files consist of an XML declaration followed by a censuses element.

<?xml version="1.0" encoding="UTF-8" ?>

Note: Make sure that your definition file is saved using UTF-8 encoding.

The censuses element contains a number of census elements, each representing a census definition. The census start-tag contains 3 attributes:

  • id : A unique code to identify the census definition.
  • title : A description of the census.
  • date : The date of the census in a Gramps date format.
<census id='UK1841' title='1841 UK Census' date='6 Jun 1841'>

Each census element should contain a column element for each column in the census. Column elements describe information that may be recorded for each person on the census.

A column element contains:

  • An _attribute element. This contains the key used to store column information in the Attributes of Event Reference objects within the Gramps database. Once defined this text must not be changed.
  • An optional _longname element. This contains a fuller description of the column that is used in the tooltips in the editor and for the heading in the census report.
  • A size element. This contains the size of the column in the census report. It is a percentage of the page width. The sum of all size elemnts in a definition should total 100.
    <_attribute>At Home</_attribute>
    <_longname>Working at Home</_longname>

Note: The underscore is important and indicates that the text should be translated by translators.

Each census element may optionally contain heading elements. Heading elements describe information that is recorded once for each census.

A heading element contains:

  • An _attribute element. This contains the key used to store census information in the Attributes of Event objects within the Gramps database.
    <_attribute>City or Borough</_attribute>

Although you can add your definitions to the pre-defined entries in census.xml, you can create a separate file called custom.xml for this purpose.

Submitting your definitions

Once you have written some custom definitions, you may wish to share them with the Gramps community.

A Census Testing area is available for this purpose.

Census Gramplet

The census gramplet consists of a census listing and a census editor.

Census Listing

When the gramplet is loaded it lists all the census events for the active person. The listing displays the census source, date and place.

A new census event can be created by clicking the "New" button at the bottom of the gramplet.

An existing census event can be edited either by highlighting a row and clicking the "Edit" button or by double-clicking on a row.

Census Editor

Census edition

The census editor is designed so that most census data can be entered into a single form.

  • The first thing to enter is the census source. This is selected from a drop-down list at the top of the editor.
  • Once the source has been selected the census date is populated automatically.
  • Next a source reference can be entered. This should comprise of one or more references that uniquely identify the census entry. In the case of a UK census you will need to enter the PRO reference, Piece, Folio and Page.
  • A place can be selected in the usual Gramps manner.

At the bottom of the editor there is a table which allows the user to enter data specific to individual people listed on the census return. A new person can be created and then added to the census by clicking the "+" button. A person already in Gramps can be added to the census by clicking the second button ("share"). A census source must be selected before people can be added to the list, and after the first person is added, the source can no longer be changed.

The cells in the table are editable. By clicking on a cell, the user can enter data from the census return into a corresponding column in the table.

A person can be removed from the list by clicking the "-" button.

The order of people in the list can be changed by highlighting a row and then using the up and down arrow buttons.

The census data can then be saved by clicking the "OK" button or discarded using "Cancel".


Census Report

The census report prints census events in a format similar to the original census entries.

Which censuses are printed is determined by settings in the Report Options.

A drop-down list allows the following options:

  • By Person
  • By Source
  • By Person and Source
  • All Census records

Use the first option to print all census records for a given person. This defaults to the current person but can be changed using a selector.

Use the second option to print all census records for a given source. Select the required source from the drop-down list.

The third option can be used to print a single census. Both the person and source selections are taken into account.

The last option prints all censuses in the database.

Census Report for Martin, John
Date:                3 Apr 1881                    
Source Reference:    17 Hope Terrace - RG 11 /2854 page 27                   
Address:             Wednesbury 
Name              Relation  Condition  Age  Occupation    Where Born    Disability
Martin, John      Head      Married    36   Laborer       Wednesbury    / 
N., Zillah        Wife                 36                 Golds Greence
Martin, Arthur    Son                  11   Scholar       Wednesbury    
Martin, Zillah    Daughter              7   Scholar       Wednesbury    
Martin, Catherine Daughter              5   Scholar       Wednesbury

NarrativeWeb Report

Census data on individual form for NarrativeWeb Report
Shared Event

Data Storage

Census data

Each census return is stored as a single event record with an event type of "Census".

The chosen source is attached to the event and contents of the "Reference" field are stored and the "Volume/Page" field of the associated source reference object.

The "Date" and "Place" fields are stored in the event object.

Each person in the table is attached to the event. The contents of the table are stored as attributes in the associated event reference object. The attribute type is set to the column heading and the value is set to the contents of the cell. An additional attribute called "Order" contains an integer which defines the position that the person appears in the census.

The addons will read existing data in this format. If "Order" attributes do not exist, they will be created when the editor saves a record. Until then the order of the people in the census will not be defined.

Data can also be edited using the usual Gramps editors.

Editing stored census return

Add Census Gramplet to Person Category. Search a person with Event reference to the stored census return you wish to edit. Clicking the stored census return opens Census Editor. In case no person is yet recorded in Census return's Details tab, go to Person Category, link an existing person or a new person to to the stored census return. Continue with opening the stored census return in Census Gramplet.

Example of using the Census Addon

This is an example of how to get started with the Census Addon after it is installed as described above. The 1841 UK census is used as the example:

  1. Start or open a family tree in Gramps.
  2. Add a person (name and gender) if this is a new family tree.
  3. Go to the Source view.
  4. Add a source with a title like "Source for 1841 Census"
  5. Add a Census key (v4.1):
    1. Open that source and go to the "Attributes" tab.
    2. Click on the plus symbol to add a key and value.
    3. Fill in the Attribute field with "Census".
    4. Fill in the Value field and with "UK1841". It is important here to not have a space in the Value. Use "UK1841", not "UK 1841".
    5. Click on OK.
  6. Add a Census key (Prior to v4.1):
    1. Open that source and go to the "Data" tab.
    2. Click on the plus symbol to add a key and value.
    3. Fill in in the key column with "Census" and hit enter.
    4. Click on Value column and fill in "UK1841", hit enter. It is important here to not have a space in the Value. Use "UK1841", not "UK 1841".
    5. Click on OK.
    6. Reopen the Source to see if the key and value pair have been successfully stored in the "Data" tab (optional).
  7. Go to the People view and switch on the sidebar (View->sidebar).
  8. Add the "Census Gramplet" by rightclicking on the side bar and choosing "Add Gramplet->Census Gramplet".
  9. Select the person that you created (or an existing person that appears in that census) in the main window.
  10. In the Census Gramplet on the sidebar, click "New".
  11. The New Census" gramplet form should open and you can click on the arrow down bútton to the right of "Source". You should see the "Source for 1841 Census". Select this.
  12. Now you can enter all of the details from the census (e.g. Reference to the page and the address), and then add people in the normal Gramps way.
  13. Fill in the details from the census page against each person.

Known Issues

When using the census editor the user should not edit the same event using the standard Gramps event editor.

When the save button in the editor is clicked, the person records of the people in the census are updated. If a person is being edited using the Gramps person editor and the record is saved then data saved using the census editor will be lost for this person.

Future Enhancements

Possible future enhancements:

  • Split the Source Reference Page/Volume field into its component parts. (e.g. Ref., Piece, Folio, Page)
  • Add the current person when creating a new census.
  • Add check-boxes to automatically add the census source to selected Gramps records.
  • Ensure that attributes are kept in the correct order in the Gramps editor.
  • Remove the need to add Data tags to sources. Create a tool to define census sources and store them in the Gramps configuration file.

External Links and resources