Create script to extract 3GPP yang modules
[scp/oam/modeling.git] / data-model / tools / extractYangFrom3gpp / 3gpp-ts-28.541 / README.md
1 # 3gpp-ts-28.541
2
3 A node.js script to extract yang modules from 3GPP TS 28.541.
4
5 ## Prerequisits
6
7 ### node.js
8
9 https://tecadmin.net/install-latest-nodejs-npm-on-ubuntu/
10
11 ```
12 $ node --version
13 v10.16.3
14 ```
15
16 ### pyang
17
18 https://anukulverma.wordpress.com/2016/03/26/pyang-installation/
19
20 ```
21 $ pyang --version
22 pyang 2.0.1
23 ```
24
25
26 ## Usage
27
28 Download latest version from [3GPP Specifications](https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=3400).
29
30 ```
31 $ wget http://www.3gpp.org/ftp//Specs/archive/28_series/28.541/28541-g20.zip --output-document=./src/resources/28541-g20.zip
32 ```
33
34 Extract the zip file.
35
36 ```
37 $ unzip ./src/resources/*.zip -d ./src/resources/
38 ```
39
40 The word document (*.doc) must be converted to a text fromat. Please use Office Libre or MS Word for manual converstion, and then use the node.js script to extract the yang modules from the text file. The last parameter is the relative path to the text file. 
41
42 ```
43 $ node ./src/js/extractYang.js src/resources/v16.2.0.txt 
44 ```
45
46 Verifiy the extracted yang modules with pyang.
47
48 ```
49 $ pyang --strict --path ./import/ ./target/*.yang
50 ```