]> git.immae.eu Git - github/fretlink/edi-parser.git/blob - scaffolder/README.md
Release code as open source
[github/fretlink/edi-parser.git] / scaffolder / README.md
1 # edi-parser-scaffolder
2
3 Autonomous utility to generate parser for a given revision of the Edifact
4 specification.
5
6 ## Usage
7
8 1. fetch specification for a given Edifact revision
9 2. scaffold the parsers for this specification
10
11 ### Read specification
12
13 Read files downloaded from
14 https://unece.org/trade/uncefact/unedifact/download
15
16 You can specify individual files one by one:
17 ```
18 $ stack exec edi-parser-scaffolder -- read-bundle --revision D96A --specification ./specification/references/ --message-file /path/to/D96A/DIRDEF_D.96A --segment-file /path/to/D96A/TRSD.96A --composite-file /path/to/D96A/TRCD.96A --simple-file /path/to/D96A/TRED.96A --simple-code-file /path/to/D96A/UNCL-1.96A --simple-code-file /path/to/D96A/UNCL-2.96A
19 $ stack exec edi-parser-scaffolder -- read-bundle --revision D21B --specification ./specification/references/ --message-file /path/to/D21B/IFCSUM_D.21B --message-file /path/to/D21B/IFTSTA_D.21B --segment-file /path/to/D21B/EDSD.21B --segment-file /path/to/D21B/IDSD.21B --composite-file /path/to/D21B/EDCD.21B --composite-file /path/to/D21B/IDCD.21B --simple-file /path/to/D21B/EDED.21B --simple-code-file /path/to/D21B/UNCL.21B
20 ```
21
22 Or give the whole zip file:
23 ```
24 $ stack exec edi-parser-scaffolder -- read-bundle --revision D96A --message IFCSUM --message IFTSTA --message IFTSAI --message DESADV --specification ./specification/references/ --bundle /path/to/D96A/d96a.zip
25 ```
26
27 ### Fetch specification
28
29 This function is deprecated and parsing may break at any time!
30 Prefer the bundle reading above
31
32 ```
33 $ stack exec edi-parser-scaffolder -- \
34 fetch --revision D96A --specification ./specification/references
35 ```
36
37 If you're only interested in a subset of the specification, you can select the
38 messages:
39
40 ```
41 $ stack exec edi-parser-scaffolder -- \
42 fetch --revision D96A --specification ./specification/references/ --messages IFCSUM,IFTSAI,DESADV
43 ```
44
45 ### Scaffold the parsers
46
47 ```
48 $ stack exec edi-parser-scaffolder -- \
49 scaffold --revision D96A --specification ./specification/references/ --src specification/src/
50 ```