Skip to main content

A package for recording Genealogy.

Project description

genealogy

A package for recording genealogylogy.

Installation

pip install genealogy

Usage

Create a person

>>> p = genealogy.person()

>>> p.create(fn=["Joe"], ln=["BLOGGS"], dob="1900-1-1", pob="Town, County")

>>> p.print()
{
    "id": "a1b2c3",
    "last_names": ["BLOGGS"],
    "first_names": ["Joe"],
    "date_of_birth": "1900-1-1",
    "place_of_birth": "Town, County",
    "date_of_death": null,
    "place_of_death": null,
    "direct_relatives": {
        "ascendants": [],
        "descendants": [],
        "partners": []
    },
    "life_events": [
        {
            "start": "1900-1-1",
            "finish": null,
            "description": "Lifetime",
            "notes": null,
            "sources": []
        }
    ]
}

>>> p.data['date_of_death'] = "1970-1-1"

>>> p.save()
a1b2c3.json saved.

Load a person

>>> p = genealogy.person()

>>> p.load("a1b2c3.json")

>>> p.print()
{
    "id": "a1b2c3",
    "last_names": ["BLOGGS"],
    "first_names": ["Joe"],
    "date_of_birth": "1900-1-1",
    "place_of_birth": "Town, County",
    "date_of_death": "1970-1-1",
    "place_of_death": null,
    "direct_relatives": {
        "ascendants": [],
        "descendants": [],
        "partners": []
    },
    "life_events": [
        {
            "start": "1900-1-1",
            "finish": null,
            "description": "Lifetime",
            "notes": null,
            "sources": []
        }
    ]
}

Add life event

>>> p = genealogy.person()

>>> p.load("a1b2c3.json")

>>> p.add_event(
        start="1900-1-1",
        description="Birth",
        notes="Town, County",
        sources=[
            "Birth Certificate of Joe BLOGGS dob 01/01/1900"
        ])

>>> p.save()
a1b2c3.json saved.

>>> p.print()
{
    "id": "a1b2c3",
    "last_names": ["BLOGGS"],
    "first_names": ["Joe"],
    "date_of_birth": "1900-1-1",
    "place_of_birth": "Town, County",
    "date_of_death": "1970-1-1",
    "place_of_death": null,
    "direct_relatives": {
        "ascendants": [],
        "descendants": [],
        "partners": []
    },
    "life_events": [
        {
            "start": "1900-1-1",
            "finish": null,
            "description": "Lifetime",
            "notes": null,
            "sources": []
        },
        {
            "start": "1900-1-1",
            "finish": null,
            "description": "Birth",
            "notes": "Town, County",
            "sources": [
                "Birth Certificate of Joe BLOGGS dob 01/01/1900"
            ]
        }
    ]
}

Edit data

>>> p = genealogy.person()

>>> p.load("a1b2c3.json")

>>> p.data['life_events][0]
{'start': None, 'finish': None, 'description': 'Lifetime', 'notes': None, 'sources': []}

>>> p.data['life_events][0]['sources'].append("Birth Certificate of Joe BLOGGS dob 01/01/1900")

>>> p.save()
a1b2c3.json saved.

>>> p.print()
{
    "id": "a1b2c3",
    "last_names": ["BLOGGS"],
    "first_names": ["Joe"],
    "date_of_birth": "1900-1-1",
    "place_of_birth": "Town, County",
    "date_of_death": "1970-1-1",
    "place_of_death": null,
    "direct_relatives": {
        "ascendants": [],
        "descendants": [],
        "partners": []
    },
    "life_events": [
        {
            "start": "1900-1-1",
            "finish": null,
            "description": "Lifetime",
            "notes": null,
            "sources": [
                "Birth Certificate of Joe BLOGGS dob 01/01/1900"
            ]
        },
        {
            "start": "1900-1-1",
            "finish": null,
            "description": "Birth",
            "notes": "Town, County",
            "sources": [
                "Birth Certificate of Joe BLOGGS dob 01/01/1900"
            ]
        }
    ]
}

Link parent(s) and child

>>> genealogy.link_child(
         parents=["g4h5i6", "m7n8o9"],
         child="a1b2c3")

>>> p = load("a1b2c3.json")

>>> p.print()
{
    "id": "a1b2c3",
    "last_names": ["BLOGGS"],
    "first_names": ["Joe"],
    "date_of_birth": "1900-1-1",
    "place_of_birth": "Town, County",
    "date_of_death": "1970-1-1",
    "place_of_death": null,
    "direct_relatives": {
        "ascendants": ["g4h5i6", "m7n8o9"],
        "descendants": [],
        "partners": []
    },
    "life_events": [
        {
            "start": "1900-1-1",
            "finish": null,
            "description": "Lifetime",
            "notes": null,
            "sources": [
                "Birth Certificate of Joe BLOGGS dob 01/01/1900"
            ]
        },
        {
            "start": "1900-1-1",
            "finish": null,
            "description": "Birth",
            "notes": "Town, County",
            "sources": [
                "Birth Certificate of Joe BLOGGS dob 01/01/1900"
            ]
        }
    ]
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genealogy-0.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

genealogy-0.0.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file genealogy-0.0.1.tar.gz.

File metadata

  • Download URL: genealogy-0.0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for genealogy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2702389421c61da23d77868734d1efd41ddb9f75155b0bb20d1d94fddf6beacb
MD5 10680afebe32a83a4125c196e5e73367
BLAKE2b-256 cc6cb27f221e71e5d72849ec8f2d0dc3a6bfdea5e542fab3e1b6c4774199fb48

See more details on using hashes here.

File details

Details for the file genealogy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: genealogy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for genealogy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 12bd59f64aece8cf4a9cdd53135b8ccfc9c833e4c59375df270fe8f0362db28d
MD5 07b174ddfd3de81ecb6dfbfedf7e14d9
BLAKE2b-256 f43d2cb853eb6b9ee25714f1dd88c3b0c953f50fe0012eb43f7dac870dc5054c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page