Gramps XML generator module Python

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Gramps XML generator module Python

tw h

I have a database with relations between people. I want to export this to Gramps. Gramps uses an XML file to exchange information.

I have looked at the XML format, but it is a difficult format to read and reverse engineer, in order to create a file myself.

Some software could assist me with this. Gramps will benefit also, because more information will become available, which attracts more information.


Is there an Python module for creating this format ?

Like:

tree = gramps.tree()

father = tree.create_person(....)

mother = tree.create_person(....)

place = tree.create_place(...)

tree.marriage(father,mother,when,place,....)

tree.write("tree.xml")


Or similar interfaces.

Where can I find such interface(s) ?






------------------------------------------------------------------------------

_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Gramps XML generator module Python

paul womack
tw h wrote:

> I have a database with relations between people. I want to export this to Gramps. Gramps uses an XML file to exchange information.
>
> I have looked at the XML format, but it is a difficult format to read and reverse engineer, in order to create a file myself.
>
> Some software could assist me with this. Gramps will benefit also, because more information will become available, which attracts more information.
>
>
> Is there an Python module for creating this format ?
>
> Like:
>
> tree = gramps.tree()
>
> father = tree.create_person(....)
>
> mother = tree.create_person(....)
>
> place = tree.create_place(...)
>
> tree.marriage(father,mother,when,place,....)
>
> tree.write("tree.xml")
>
>
> Or similar interfaces.
>
> Where can I find such interface(s) ?

Use GEDCOM.

    BugBear


------------------------------------------------------------------------------
_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users
Reply | Threaded
Open this post in threaded view
|

Re: Gramps XML generator module Python

DS Blank
In reply to this post by tw h
On Wed, Aug 31, 2016 at 5:40 AM, tw h <[hidden email]> wrote:

I have a database with relations between people. I want to export this to Gramps. Gramps uses an XML file to exchange information.


Gramps can read and write a few formats, including: json, xml, csv (partial data), and of course GEDCOM.
 

I have looked at the XML format, but it is a difficult format to read and reverse engineer, in order to create a file myself.

Some software could assist me with this. Gramps will benefit also, because more information will become available, which attracts more information.

If your database is not in a common format, then your program is just a one-off conversion?
 


Is there an Python module for creating this format ?

Like:

tree = gramps.tree()

father = tree.create_person(....)

mother = tree.create_person(....)

place = tree.create_place(...)

tree.marriage(father,mother,when,place,....)

tree.write("tree.xml")


Or similar interfaces.

Where can I find such interface(s) ?


There is a gramps-developer mailing list that may be more appropriate for programming questions. We have an interface very similar, but it is at the database level, not an exchange format.

If your database is just relations between people, the csv may be the easiest to use:


If you want to be able to import more information than what csv can handle, you might be interested in the json format which I find more explicit than gramps' xml. Each primary object knows how to convert itself to json.

-Doug
 






------------------------------------------------------------------------------

_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users



------------------------------------------------------------------------------

_______________________________________________
Gramps-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-users