Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
PyI40AAS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lehrstuhl für Informations- und Automatisierungssysteme
PyI40AAS
Merge requests
!33
compliance_tool: update readme
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
compliance_tool: update readme
feature/compliance_tool_update_readme
into
master
Overview
16
Commits
6
Pipelines
13
Changes
2
1 unresolved thread
Show all comments
Merged
Torben Miny
requested to merge
feature/compliance_tool_update_readme
into
master
5 years ago
Overview
16
Commits
6
Pipelines
13
Changes
2
1 unresolved thread
Show all comments
Update readme to fix
#70 (closed)
0
0
Merge request reports
Compare
master
version 5
8908849b
5 years ago
version 4
7c321883
5 years ago
version 3
bdd98632
5 years ago
version 2
6bac922c
5 years ago
version 1
4378d432
5 years ago
master (base)
and
latest version
latest version
dc4011ae
6 commits,
5 years ago
version 5
8908849b
5 commits,
5 years ago
version 4
7c321883
4 commits,
5 years ago
version 3
bdd98632
3 commits,
5 years ago
version 2
6bac922c
2 commits,
5 years ago
version 1
4378d432
1 commit,
5 years ago
2 files
+
55
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
aas/compliance_tool/cli.py
+
38
−
10
View file @ dc4011ae
Edit in single-file editor
Open in Web IDE
Show full file
@@ -30,28 +30,56 @@ def main():
parser
=
argparse
.
ArgumentParser
(
prog
=
'
compliance_tool
'
,
description
=
'
Compliance tool for creating and checking json and xml files in compliance with
"
Details of the
'
'
Asset Administration Shell
"
specification of Plattform Industrie 4.0.
'
,
'
Asset Administration Shell
"
specification of Plattform Industrie 4.0.
\n\n
'
'
This tool has five features:
\n
'
'
1. create an xml or json file with example aas elements
\n
'
'
2. check a given xml or json file if it is compliant with the official json or xml aas schema
\n
'
'
3. check if a given xml or json file is deserializable
\n
'
'
4. check if the data in a given xml or json file is the same as the example data
\n
'
'
5. check if two given xml or json files contain the same aas elements in any order
\n\n
'
'
As a first argument, the feature must be specified (create, schema, deserialization, example,
'
'
files) or in short (c, s, d, e or f).
\n
'
'
Depending the chosen feature, different additional arguments must be specified:
\n
'
'
create or c: path to the file which shall be created (file_1)
\n
'
'
schema or s: file to be checked (file_1) and the path to the official aas
'
'
schema (-s or --schema)
\n
'
'
deserialization or d: file to be checked (file_1)
\n
'
'
example or e: file to be checked (file_1)
\n
'
'
file_compare or f: files to compare (file_1, file_2)
\n
'
'
In any case, it must be specified whether the (given or created) files are json (--json) or
'
'
xml (--xml).
\n\n
'
'
Additionally, the tool offers some extra features for more convenient usage:
\n
'
'
a. Different levels of verbosity:
\n
'
'
Default output is just the status for each step performed. With -v or --verbose, additional
'
'
information in case of status = FAILED will be provided. With one more -v or --verbose, additional
'
'
information even in case of status = SUCCESS or WARNINGS will be provided.
\n
'
'
b. Suppressing output on success:
\n
'
'
With -q or --quite no output will be generated if the status = SUCCESS.
\n
'
'
c. Save log additionally in a logfile:
\n
'
'
With -l or --logfile, a path to the file where the logfiles shall be created can be specified.
'
,
formatter_class
=
argparse
.
RawTextHelpFormatter
)
parser
.
add_argument
(
'
action
'
,
choices
=
[
'
create
'
,
'
c
'
,
'
schema
'
,
'
s
'
,
'
deserialization
'
,
'
d
'
,
'
example
'
,
'
e
'
,
'
files
'
,
'
f
'
],
help
=
'
c or create: creates a file with
the
example data
with the given file path
\n
'
'
s or schema: checks a given file if it is compliance with the official
json
schema
\n
'
help
=
'
c or create: creates a file with example data
\n
'
'
s or schema: checks a given file if it is compliance with the official schema
\n
'
'
d or deserialization: checks if a given file is deserializable
\n
'
'
e or example: checks if a given file contains the example aas elements
\n
'
'
f or file
s
: checks if two given files contain
s
the same aas elements in any order
'
)
'
f or file
_compare
: checks if two given files contain the same aas elements in any order
'
)
parser
.
add_argument
(
'
file_1
'
,
help
=
"
path to file 1
"
)
parser
.
add_argument
(
'
file_2
'
,
nargs
=
'
?
'
,
default
=
None
,
help
=
"
path to file 2: is required if action f or files is
"
"
choosen
"
)
parser
.
add_argument
(
'
-s
'
,
'
--schema
'
,
help
=
"
path to the aas schema: is required if action s or schema is choosen.
"
,
parser
.
add_argument
(
'
-s
'
,
'
--schema
'
,
help
=
"
path to the AAS xml/json schema file. Required, if action
'
s
'
or
"
"'
schema
'
is choosen.
"
,
default
=
None
)
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
help
=
"
display all information occurred while checking: 1: Error information,
"
"
2: Additional Success information
"
,
action
=
'
count
'
,
default
=
0
)
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
help
=
"
Print detailed information for each check. Multiple -v options
"
"
increase the verbosity. 1: Detailed error information, 2: Additional
"
"
detailed success information
"
,
action
=
'
count
'
,
default
=
0
)
parser
.
add_argument
(
'
-q
'
,
'
--quite
'
,
help
=
"
no information output if successful
"
,
action
=
'
store_true
'
)
group
=
parser
.
add_mutually_exclusive_group
(
required
=
True
)
group
.
add_argument
(
'
--json
'
,
help
=
"
checking or creating
json
file
(s)
"
,
action
=
'
store_true
'
)
group
.
add_argument
(
'
--xml
'
,
help
=
"
checking or creating
xml
file
(s)
"
,
action
=
'
store_true
'
)
parser
.
add_argument
(
'
-l
'
,
'
--logfile
'
,
help
=
"
creates the log additional in the given file
"
,
default
=
None
)
group
.
add_argument
(
'
--json
'
,
help
=
"
Use AAS json format when
checking or creating file
s
"
,
action
=
'
store_true
'
)
group
.
add_argument
(
'
--xml
'
,
help
=
"
Use AAS xml format when
checking or creating file
s
"
,
action
=
'
store_true
'
)
parser
.
add_argument
(
'
-l
'
,
'
--logfile
'
,
help
=
"
Log file to be created in addition to output to stdout
"
,
default
=
None
)
args
=
parser
.
parse_args
()
Loading