|
@@ -11,6 +11,31 @@ $ pip3 install --user --upgrade yamily
|
|
|
|
|
|
## Usage
|
|
## Usage
|
|
|
|
|
|
|
|
+### Import YAML
|
|
|
|
+
|
|
|
|
+```python
|
|
|
|
+>>> import yaml, yamily, yamily.yaml
|
|
|
|
+>>> alice_yaml = '''
|
|
|
|
+... !person
|
|
|
|
+... identifier: alice
|
|
|
|
+... name: Alice Test
|
|
|
|
+... birth_date: 2019-12-23
|
|
|
|
+... mother: !person
|
|
|
|
+... identifier: alice-mother
|
|
|
|
+... name: Carol Test
|
|
|
|
+... birth_date: 1992-10-26
|
|
|
|
+... father: !person
|
|
|
|
+... identifier: bob
|
|
|
|
+... name: Bob Test
|
|
|
|
+... '''
|
|
|
|
+>>> alice = yaml.load(alice_yaml, Loader=yamily.yaml.Loader)
|
|
|
|
+>>> alice
|
|
|
|
+Person(alice, Alice Test, *2019-12-23)
|
|
|
|
+>>> alice.mother
|
|
|
|
+Person(alice-mother, Carol Test, *1992-10-26)
|
|
|
|
+
|
|
|
|
+```
|
|
|
|
+
|
|
### Export YAML
|
|
### Export YAML
|
|
|
|
|
|
```python
|
|
```python
|