Commit 05403ab 1 parent 28fcac9 commit 05403ab Copy full SHA for 05403ab
File tree 3 files changed +29
-1
lines changed
3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 2
2
pip install -r scripts/requirements-test.txt
3
3
4
4
validate : setup # # Validate data
5
- goodtables datapackage datapackage.json
5
+ @echo Validation command not yet implemented.
6
+
7
+ json : setup # # Generate JSON from YAML
8
+ python scripts/yaml2json.py < data/committees.yml > outputs/committees.json
6
9
7
10
dummy : # # Perform a dummy action with outputs
8
11
python scripts/run_dummy_action.py
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ Usage: make <command>
23
23
where <command> is one of the following:
24
24
25
25
validate Validate data
26
+ json Generate JSON from YAML
26
27
dummy Perform a dummy action with outputs
27
28
```
28
29
Original file line number Diff line number Diff line change
1
+ # convert yaml to json
2
+ # pip3 install pyyaml
3
+ # http://pyyaml.org/wiki/PyYAMLDocumentation
4
+ # py3 yaml2json.py < ~/code/manpow/homeland/heartland/puphpet/config.yaml
5
+ # gist https://gist.github.com/noahcoad/51934724e0896184a2340217b383af73
6
+
7
+ import json
8
+ import sys
9
+ import yaml
10
+
11
+
12
+ # See: http://stackoverflow.com/a/25895504
13
+ def date_handler (obj ):
14
+ if hasattr (obj , 'isoformat' ):
15
+ return obj .isoformat ()
16
+ else :
17
+ raise TypeError
18
+
19
+ yml = yaml .load (sys .stdin )
20
+
21
+ sys .stdout .write (json .dumps (yml ,
22
+ sort_keys = True ,
23
+ indent = 2 ,
24
+ default = date_handler ))
You can’t perform that action at this time.
0 commit comments