|
@@ -2,14 +2,41 @@
|
|
|
|
|
|
Define family trees in YAML
|
|
|
|
|
|
-## setup
|
|
|
+## Setup
|
|
|
|
|
|
```sh
|
|
|
$ sudo apt-get install python3-yaml # optional on debian
|
|
|
$ pip3 install --user --upgrade yamily
|
|
|
```
|
|
|
|
|
|
-## develop
|
|
|
+## Usage
|
|
|
+
|
|
|
+### Export YAML
|
|
|
+
|
|
|
+```python
|
|
|
+>>> 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
|
|
|
|
|
|
```sh
|
|
|
$ git clone git@git.hammerle.me:fphammerle/yamily.git
|