Skip to main content

A lightweight tool to parse, browse and edit gedcom files.

Project description

FastGedcom

A lightweight tool to parse, browse and edit gedcom files.

Install FastGedcom using pip from its PyPI page:

pip install fastgedcom

Features

Easy to write! Free choice of fields, data, and formatting.

from fastgedcom.parser import strict_parse
from fastgedcom.helpers import format_date

document = strict_parse("gedcom_file.ged")

birth_date = (document["@I1@"] > "BIRT") >= "DATE"
print(format_date(birth_date))

The syntax is flexible and permissive. If you don't like magic operator overloads, you can use standard methods!

It supports gedcom files encoded in UTF-8 (with and without BOM), UTF-16 (also named UNICODE), ANSI, and ANSEL.

If a field is missing, you will get a FakeLine containing an empty string. This help reducing the boiler plate code massively. And, you can differentiate a TrueLine from a FakeLine with a simple boolean check.

indi = document["@I13@"]
death = indi > "DEAT"
if not death:
	print("No DEAT field. The person is alive")
# Can continue anyway
print("Death date:", format_date((indi > "DEAT") >= "DATE"))

Typehints for salvation! Autocompletion and type checking make development so much easier.

Why FastGedcom ?

FastGedcom's aim is to keep the code close to your gedcom files. So, you don't have to learn what FastGedcom does, the data you have, is the data you get. The content of the gedcom file is unchanged. The data processing is optional to best suit your needs. FastGedcom is more of a starting point of your data processing than a all-round full-featured librairy.

The name FastGedcom doesn't just come from its ease of use. Parsing is really fast. And, for getting the relatives of a person as fast as possible, there is the FamilyLink class. Here are the benchmark I used.

Documentation and examples

Want to see more code? Here are some examples

The documentation of FastGedcom is available here on ReadTheDocs.

Feedback

Feedback are welcome, and they will be greatly appreciated!

If you like this project, consider putting a star on Github, thank you!

For any feedback or question, please feel free to contact me by email at gatien.bouyer.dev@gmail.com or via Github issues.

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

fastgedcom-1.0.0.tar.gz (19.1 kB view hashes)

Uploaded Source

Built Distribution

fastgedcom-1.0.0-py3-none-any.whl (14.5 kB view hashes)

Uploaded Python 3

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