Skip to main content

This program creates family tree graphs from a simple text files

Project description

familytreemaker

This program creates family tree graphs from simple text files.

The input file format is very simple, you describe persons of your family line by line, children just have to follow parents in the file. Persons can be repeated as long as they keep the same name or id. An example is given in the file LouisXIVfamily.txt.

Note: This branch version is optimized for chinese. If other language for input text file is used, command option gender (-g) has to be used to specify words of male and female, since their default values are set as "男" and "女" instead of origin "M" and "F".

Installation

Simply clone the repo or install package familytree by pip as shown below:

pip install familytree

This script outputs a graph descriptor in DOT format. To make the image containing the graph, you will need a graph drawer such as [GraphViz] 1.

Usage

usage: familytreemaker.py [-h] [-a ANCESTOR] [-g GENDER] [-v INFOLEVEL]
                          [-o OUTFILE]
                          INPUTFILE

Generates a family tree graph from a simple text file

positional arguments:
  INPUTFILE     the formatted text file representing the family

optional arguments:
  -h, --help    show this help message and exit
  -a ANCESTOR   make the family tree from an ancestor (if omitted, the program
                will try to find an ancestor)
  -g GENDER     customized gender string, for example: "男,女" or "M,F"
  -v INFOLEVEL  Information level (0/1/2) to output. (0 - only name and
                surfname will be output; 1 - time of birthday and deathday
                will be invisable; 2 - all information will be output)
  -o OUTFILE    file name for output

The sample family descriptor LouisXIVfamily.txt is here to show you the usage. Simply run:

python familytreemaker.py -a "王灿文" -v2 -o LouisXIVfamily.dot LouisXIVfamily.txt && \
    dot -Tsvg -o LouisXIVfamily.svg LouisXIVfamily.dot

If package familytree has been installed by pip, commands below can be performed to populate:

python -m familytree.familytreemaker -a "王灿文" -v2 -o LouisXIVfamily.dot LouisXIVfamily.txt && \
    dot -Tsvg -o LouisXIVfamily.svg LouisXIVfamily.dot

It will generate the tree from the infos in LouisXIVfamily.txt, starting from 王灿文 and saving the image in LouisXIVfamily.svg.

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

familytree-0.0.11.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

familytree-0.0.11-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file familytree-0.0.11.tar.gz.

File metadata

  • Download URL: familytree-0.0.11.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.5.2

File hashes

Hashes for familytree-0.0.11.tar.gz
Algorithm Hash digest
SHA256 2925e93130805b4f9683cc8d16bbcbcef354752db4952dcfff5e33b2c4a2ad34
MD5 63e8d8bed47d6ab7ad95126334e60177
BLAKE2b-256 a89183b1b54cadf20e9adb4e01ba2879fbee482d0b92f491d7ce01d1557bccbc

See more details on using hashes here.

File details

Details for the file familytree-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: familytree-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.4.0 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.5.2

File hashes

Hashes for familytree-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 3f7265f58f0c56d845b32ddc74845887308bbc554cae6d411e8c1139775adf71
MD5 2e507b708bc83f425dadf09a093c7410
BLAKE2b-256 89fb5849f395f32884aed276aa8289efeea73c2847be555e366e8a4f8faddd69

See more details on using hashes here.

Supported by

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