Welcome to the Family Echo Q&A forum. In order to ask or answer questions, please ensure you sign in at Family Echo first.
Welcome to Family Echo Q&A, where you can ask questions and receive answers from other members of the community.

In order to ask or answer questions, please ensure you sign in at Family Echo first.

Before asking a question, please check the Frequently Asked Questions page.

API Python Example

0 votes
224 views

This isn't really a question. I just wanted some place to stick some example code for when people ask about it. 

#
# 1) first install requests from the command line: python -m pip install requests
#
import requests
 
def main():
    format = 'json'
    operation = 'temp_view'
    family = sample_GEDCOM_file()
 
    payload = {'format': format, 'operation': operation, 'family': family}
    response = requests.post(url, data=payload)
 
    print(response.text)
 
def sample_GEDCOM_file():
    return """
0 HEAD
1 SOUR Family Echo
1 FILE Family 28
1 DATE 1 OCT 2022
1 DEST ANSTFILE
1 GEDC
2 VERS 5.5.1
2 FORM LINEAGE-LINKED
1 SUBM @I1@
2 NAME Lloyd Sommerer
1 SUBN
1 CHAR UTF-8
0 @I1@ INDI
1 NAME Lloyd /Sommerer/
2 GIVN Lloyd
2 NSFX Jr.
2 SURN Sommerer
2 _MARNM Sommerer
1 FAMC @F1@
0 @I2@ INDI
1 NAME Lloyd /Sommerer/
2 GIVN Lloyd
2 NSFX Sr.
2 SURN Sommerer
2 _MARNM Sommerer
1 SEX M
1 FAMS @F1@
0 @I3@ INDI
1 NAME Jane /Sommerer/
2 GIVN Jane
2 SURN Sommerer
2 _MARNM Sommerer
1 SEX F
1 FAMS @F1@
0 @F1@ FAM
1 HUSB @I2@
1 WIFE @I3@
1 CHIL @I1@
1 _CURRENT Y
1 _PRIMARY Y
0 TRLR
"""
 
main()
 
asked Jan 26 by lsommerer (51,650 points)

1 Answer

0 votes
Just adding an answer so that people don't think this is an actual question. Nothing to see here, folks.
answered Jan 26 by lsommerer (51,650 points)
...