tidas-tools 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.3
2
+ Name: tidas-tools
3
+ Version: 0.0.1
4
+ Summary: tidas-tools
5
+ Author: Nan LI
6
+ Author-email: linanenv@gmail.com
7
+ Requires-Python: >=3.9
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.9
10
+ Classifier: Programming Language :: Python :: 3.10
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Requires-Dist: jsonschema (==4.23.0)
15
+ Requires-Dist: xmltodict (==0.14.2)
16
+ Description-Content-Type: text/markdown
17
+
18
+
19
+ # TianGong TIDAS Toolbox
20
+
21
+ ## Env Preparing
22
+
23
+ ### Using Ubuntu
24
+
25
+ ```bash
26
+
27
+ sudo apt update
28
+ sudo apt install software-properties-common
29
+ sudo add-apt-repository ppa:deadsnakes/ppa
30
+ sudo apt install -y python3.12
31
+
32
+ sudo apt install libxml2-dev libxslt-dev
33
+ sudo apt-get install build-essential python3-dev
34
+
35
+
36
+ sudo apt upgrade
37
+ ```
38
+
39
+ ### Using Poetry
40
+
41
+ ```bash
42
+ curl -sSL https://install.python-poetry.org | python3 -
43
+
44
+ poetry env activate
45
+
46
+ poetry env info
47
+
48
+ poetry lock
49
+ poetry install
50
+
51
+ ```
52
+
53
+ ### Auto Build
54
+
55
+ The auto build will be triggered by pushing any tag named like release-v$version. For instance, push a tag named as v0.0.1 will build a docker image of 0.0.1 version.
56
+
57
+ ```bash
58
+ #list existing tags
59
+ git tag
60
+ #creat a new tag
61
+ git tag v0.0.1
62
+ #push this tag to origin
63
+ git push origin v0.0.1
64
+ ```
65
+
66
+
67
+ ### Lint and Format
68
+
69
+ ```bash
70
+ black .
71
+ ```
72
+
@@ -0,0 +1,54 @@
1
+
2
+ # TianGong TIDAS Toolbox
3
+
4
+ ## Env Preparing
5
+
6
+ ### Using Ubuntu
7
+
8
+ ```bash
9
+
10
+ sudo apt update
11
+ sudo apt install software-properties-common
12
+ sudo add-apt-repository ppa:deadsnakes/ppa
13
+ sudo apt install -y python3.12
14
+
15
+ sudo apt install libxml2-dev libxslt-dev
16
+ sudo apt-get install build-essential python3-dev
17
+
18
+
19
+ sudo apt upgrade
20
+ ```
21
+
22
+ ### Using Poetry
23
+
24
+ ```bash
25
+ curl -sSL https://install.python-poetry.org | python3 -
26
+
27
+ poetry env activate
28
+
29
+ poetry env info
30
+
31
+ poetry lock
32
+ poetry install
33
+
34
+ ```
35
+
36
+ ### Auto Build
37
+
38
+ The auto build will be triggered by pushing any tag named like release-v$version. For instance, push a tag named as v0.0.1 will build a docker image of 0.0.1 version.
39
+
40
+ ```bash
41
+ #list existing tags
42
+ git tag
43
+ #creat a new tag
44
+ git tag v0.0.1
45
+ #push this tag to origin
46
+ git push origin v0.0.1
47
+ ```
48
+
49
+
50
+ ### Lint and Format
51
+
52
+ ```bash
53
+ black .
54
+ ```
@@ -0,0 +1,24 @@
1
+ [project]
2
+ name = "tidas-tools"
3
+ version = "0.0.1"
4
+ description = "tidas-tools"
5
+ authors = [
6
+ {name = "Nan LI",email = "linanenv@gmail.com"}
7
+ ]
8
+ readme = "README.md"
9
+ requires-python = ">=3.9"
10
+ dependencies = [
11
+ "jsonschema==4.23.0",
12
+ "xmltodict==0.14.2",
13
+ ]
14
+
15
+ [tool.poetry]
16
+ packages = [{include = "tidas_tools", from = "src"}]
17
+ include = ["src/tidas_tools/schemas/*.json"]
18
+
19
+ [tool.poetry.group.dev.dependencies]
20
+ black = "^25.1.0"
21
+
22
+ [build-system]
23
+ requires = ["poetry-core>=2.0.0,<3.0.0"]
24
+ build-backend = "poetry.core.masonry.api"
@@ -0,0 +1,4 @@
1
+ from .convert import convert_json_to_xml, convert_xml_to_json
2
+ from .validate import category_validate
3
+
4
+ __all__ = ["category_validate", "convert_xml_to_json", "convert_json_to_xml"]
@@ -0,0 +1,9 @@
1
+ import xmltodict
2
+
3
+
4
+ def convert_xml_to_json(xml_data):
5
+ return xmltodict.parse(xml_data)
6
+
7
+
8
+ def convert_json_to_xml(json_data):
9
+ return xmltodict.unparse(json_data)
@@ -0,0 +1,125 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "contactDataSet": {
6
+ "type": "object",
7
+ "properties": {
8
+ "@xmlns:common": {
9
+ "type": "string"
10
+ },
11
+ "@xmlns": {
12
+ "type": "string"
13
+ },
14
+ "@xmlns:xsi": {
15
+ "type": "string"
16
+ },
17
+ "@version": {
18
+ "type": "string"
19
+ },
20
+ "@xsi:schemaLocation": {
21
+ "type": "string"
22
+ },
23
+ "contactInformation": {
24
+ "type": "object",
25
+ "properties": {
26
+ "dataSetInformation": {
27
+ "type": "object",
28
+ "properties": {
29
+ "common:UUID": {
30
+ "type": "string",
31
+ "format": "uuid"
32
+ },
33
+ "common:shortName": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "object",
37
+ "properties": {
38
+ "@xml:lang": {
39
+ "type": "string"
40
+ },
41
+ "#text": {
42
+ "type": "string"
43
+ }
44
+ },
45
+ "required": ["@xml:lang", "#text"]
46
+ }
47
+ },
48
+ "common:name": {
49
+ "type": "array",
50
+ "items": {
51
+ "type": "object",
52
+ "properties": {
53
+ "@xml:lang": {
54
+ "type": "string"
55
+ },
56
+ "#text": {
57
+ "type": "string"
58
+ }
59
+ },
60
+ "required": ["@xml:lang", "#text"]
61
+ }
62
+ },
63
+ "classificationInformation": {
64
+ "type": "object",
65
+ "properties": {
66
+ "common:classification": {
67
+ "type": "object",
68
+ "properties": {
69
+ "common:class": {
70
+ "type": "object",
71
+ "properties": {
72
+ "@level": {
73
+ "type": "string"
74
+ },
75
+ "#text": {
76
+ "type": "string"
77
+ }
78
+ },
79
+ "required": ["@level", "#text"]
80
+ }
81
+ },
82
+ "required": ["common:class"]
83
+ }
84
+ },
85
+ "required": ["common:classification"]
86
+ },
87
+ "email": {
88
+ "type": "string",
89
+ "format": "email"
90
+ }
91
+ },
92
+ "required": ["common:UUID", "common:shortName", "common:name", "email"]
93
+ }
94
+ },
95
+ "required": ["dataSetInformation"]
96
+ },
97
+ "administrativeInformation": {
98
+ "type": "object",
99
+ "properties": {
100
+ "publicationAndOwnership": {
101
+ "type": "object",
102
+ "properties": {
103
+ "common:dataSetVersion": {
104
+ "type": "string"
105
+ }
106
+ },
107
+ "required": ["common:dataSetVersion"]
108
+ }
109
+ },
110
+ "required": ["publicationAndOwnership"]
111
+ }
112
+ },
113
+ "required": [
114
+ "@xmlns:common",
115
+ "@xmlns",
116
+ "@xmlns:xsi",
117
+ "@version",
118
+ "@xsi:schemaLocation",
119
+ "contactInformation",
120
+ "administrativeInformation"
121
+ ]
122
+ }
123
+ },
124
+ "required": ["contactDataSet"]
125
+ }
@@ -0,0 +1,196 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "flowPropertyDataSet": {
6
+ "type": "object",
7
+ "properties": {
8
+ "@xmlns": { "type": "string" },
9
+ "@xmlns:common": { "type": "string" },
10
+ "@xmlns:xsi": { "type": "string" },
11
+ "@version": { "type": "string" },
12
+ "@xsi:schemaLocation": { "type": "string" },
13
+ "flowPropertiesInformation": {
14
+ "type": "object",
15
+ "properties": {
16
+ "dataSetInformation": {
17
+ "type": "object",
18
+ "properties": {
19
+ "common:UUID": { "type": "string" },
20
+ "common:name": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "object",
24
+ "properties": {
25
+ "@xml:lang": { "type": "string" },
26
+ "#text": { "type": "string" }
27
+ },
28
+ "required": ["@xml:lang", "#text"]
29
+ }
30
+ },
31
+ "common:synonyms": {
32
+ "type": "object",
33
+ "properties": {
34
+ "@xml:lang": { "type": "string" },
35
+ "#text": { "type": "string" }
36
+ },
37
+ "required": ["@xml:lang", "#text"]
38
+ },
39
+ "classificationInformation": {
40
+ "type": "object",
41
+ "properties": {
42
+ "common:classification": {
43
+ "type": "object",
44
+ "properties": {
45
+ "common:class": {
46
+ "type": "object",
47
+ "properties": {
48
+ "@level": { "type": "string" },
49
+ "#text": { "type": "string" }
50
+ },
51
+ "required": ["@level", "#text"]
52
+ }
53
+ },
54
+ "required": ["common:class"]
55
+ }
56
+ },
57
+ "required": ["common:classification"]
58
+ },
59
+ "common:generalComment": {
60
+ "type": "object",
61
+ "properties": {
62
+ "@xml:lang": { "type": "string" },
63
+ "#text": { "type": "string" }
64
+ },
65
+ "required": ["@xml:lang", "#text"]
66
+ }
67
+ },
68
+ "required": ["common:UUID", "common:name"]
69
+ },
70
+ "quantitativeReference": {
71
+ "type": "object",
72
+ "properties": {
73
+ "referenceToReferenceUnitGroup": {
74
+ "type": "object",
75
+ "properties": {
76
+ "@refObjectId": { "type": "string" },
77
+ "@type": { "type": "string" },
78
+ "@uri": { "type": "string" },
79
+ "common:shortDescription": {
80
+ "type": "object",
81
+ "properties": {
82
+ "@xml:lang": { "type": "string" },
83
+ "#text": { "type": "string" }
84
+ },
85
+ "required": ["@xml:lang", "#text"]
86
+ }
87
+ },
88
+ "required": ["@refObjectId", "@type", "@uri"]
89
+ }
90
+ },
91
+ "required": ["referenceToReferenceUnitGroup"]
92
+ }
93
+ },
94
+ "required": ["dataSetInformation", "quantitativeReference"]
95
+ },
96
+ "modellingAndValidation": {
97
+ "type": "object",
98
+ "properties": {
99
+ "complianceDeclarations": {
100
+ "type": "object",
101
+ "properties": {
102
+ "compliance": {
103
+ "type": "array",
104
+ "items": {
105
+ "type": "object",
106
+ "properties": {
107
+ "common:referenceToComplianceSystem": {
108
+ "type": "object",
109
+ "properties": {
110
+ "@refObjectId": { "type": "string" },
111
+ "@type": { "type": "string" },
112
+ "@uri": { "type": "string" },
113
+ "common:shortDescription": {
114
+ "type": "object",
115
+ "properties": {
116
+ "@xml:lang": { "type": "string" },
117
+ "#text": { "type": "string" }
118
+ },
119
+ "required": ["@xml:lang", "#text"]
120
+ }
121
+ },
122
+ "required": ["@refObjectId", "@type", "@uri"]
123
+ },
124
+ "common:approvalOfOverallCompliance": { "type": "string" }
125
+ },
126
+ "required": ["common:referenceToComplianceSystem", "common:approvalOfOverallCompliance"]
127
+ }
128
+ }
129
+ },
130
+ "required": ["compliance"]
131
+ }
132
+ },
133
+ "required": ["complianceDeclarations"]
134
+ },
135
+ "administrativeInformation": {
136
+ "type": "object",
137
+ "properties": {
138
+ "dataEntryBy": {
139
+ "type": "object",
140
+ "properties": {
141
+ "common:timeStamp": { "type": "string" },
142
+ "common:referenceToDataSetFormat": {
143
+ "type": "object",
144
+ "properties": {
145
+ "@refObjectId": { "type": "string" },
146
+ "@type": { "type": "string" },
147
+ "@uri": { "type": "string" },
148
+ "common:shortDescription": {
149
+ "type": "object",
150
+ "properties": {
151
+ "@xml:lang": { "type": "string" },
152
+ "#text": { "type": "string" }
153
+ },
154
+ "required": ["@xml:lang", "#text"]
155
+ }
156
+ },
157
+ "required": ["@refObjectId", "@type", "@uri"]
158
+ }
159
+ },
160
+ "required": ["common:timeStamp", "common:referenceToDataSetFormat"]
161
+ },
162
+ "publicationAndOwnership": {
163
+ "type": "object",
164
+ "properties": {
165
+ "common:dataSetVersion": { "type": "string" },
166
+ "common:referenceToPrecedingDataSetVersion": {
167
+ "type": "object",
168
+ "properties": {
169
+ "@refObjectId": { "type": "string" },
170
+ "@type": { "type": "string" },
171
+ "@uri": { "type": "string" },
172
+ "common:shortDescription": {
173
+ "type": "object",
174
+ "properties": {
175
+ "@xml:lang": { "type": "string" },
176
+ "#text": { "type": "string" }
177
+ },
178
+ "required": ["@xml:lang", "#text"]
179
+ }
180
+ },
181
+ "required": ["@refObjectId", "@type", "@uri"]
182
+ },
183
+ "common:permanentDataSetURI": { "type": "string" }
184
+ },
185
+ "required": ["common:dataSetVersion", "common:referenceToPrecedingDataSetVersion", "common:permanentDataSetURI"]
186
+ }
187
+ },
188
+ "required": ["dataEntryBy", "publicationAndOwnership"]
189
+ }
190
+ },
191
+ "required": ["@xmlns", "@xmlns:common", "@xmlns:xsi", "@version", "@xsi:schemaLocation", "flowPropertiesInformation", "modellingAndValidation", "administrativeInformation"]
192
+ }
193
+ },
194
+ "required": ["flowPropertyDataSet"]
195
+ }
196
+