Define family trees in YAML http://pypi.org/project/yamily

Fabian Peter Hammerle d97deb8759 readme: added yaml export sample 4 vuotta sitten
.githooks d97deb8759 readme: added yaml export sample 4 vuotta sitten
tests edbb8bea9a lint tests 4 vuotta sitten
yamily 762a858e4b added class docstrings 4 vuotta sitten
.gitignore 16db0bdf18 added pytest-cov 4 vuotta sitten
.pylintrc 762a858e4b added class docstrings 4 vuotta sitten
Pipfile f13d438e9c added cli entry point `yamily-list` 4 vuotta sitten
Pipfile.lock f13d438e9c added cli entry point `yamily-list` 4 vuotta sitten
README.md d97deb8759 readme: added yaml export sample 4 vuotta sitten
conftest.py ecfca36c84 added yaml loader for person class 4 vuotta sitten
pytest.ini 27bdc55133 pytest: permanently enable doctest 4 vuotta sitten
setup.py f13d438e9c added cli entry point `yamily-list` 4 vuotta sitten

README.md

yamily

Define family trees in YAML

Setup

$ sudo apt-get install python3-yaml # optional on debian
$ pip3 install --user --upgrade yamily

Usage

Export YAML

>>> import datetime, yaml, yamily, yamily.yaml
>>> alice = yamily.Person("alice")
>>> alice.name = "Alice Test"
>>> alice.birth_date = datetime.date(2019, 12, 23)
>>> alice
Person(alice, Alice Test, *2019-12-23)

>>> alice.father = yamily.Person("alice-father")
>>> alice.father.name = "Bob Test"

>>> print(yaml.dump(alice, Dumper=yamily.yaml.Dumper))
!person
birth_date: 2019-12-23
father: !person
  identifier: alice-father
  name: Bob Test
identifier: alice
name: Alice Test
<BLANKLINE>

Develop

$ git clone git@git.hammerle.me:fphammerle/yamily.git
$ cd yamily
$ git config --local core.hooksPath .githooks/