OpenGeodeWeb-Back 5.6.6rc1__py3-none-any.whl → 5.7.0__py3-none-any.whl
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.
- opengeodeweb_back/routes/blueprint_routes.py +11 -1
- opengeodeweb_back/routes/models/blueprint_models.py +74 -0
- opengeodeweb_back/routes/models/schemas/mesh_components.json +20 -0
- opengeodeweb_back/routes/models/schemas/vtm_component_indices.json +16 -0
- {opengeodeweb_back-5.6.6rc1.dist-info → opengeodeweb_back-5.7.0.dist-info}/METADATA +16 -17
- {opengeodeweb_back-5.6.6rc1.dist-info → opengeodeweb_back-5.7.0.dist-info}/RECORD +9 -6
- {opengeodeweb_back-5.6.6rc1.dist-info → opengeodeweb_back-5.7.0.dist-info}/WHEEL +1 -1
- {opengeodeweb_back-5.6.6rc1.dist-info → opengeodeweb_back-5.7.0.dist-info}/licenses/LICENSE +0 -0
- {opengeodeweb_back-5.6.6rc1.dist-info → opengeodeweb_back-5.7.0.dist-info}/top_level.txt +0 -0
@@ -12,7 +12,9 @@ import werkzeug
|
|
12
12
|
# Local application imports
|
13
13
|
from .. import geode_functions, utils_functions
|
14
14
|
|
15
|
-
|
15
|
+
from .models import blueprint_models
|
16
|
+
|
17
|
+
routes = flask.Blueprint("routes", __name__, url_prefix="/opengeodeweb_back")
|
16
18
|
|
17
19
|
|
18
20
|
@routes.before_request
|
@@ -23,11 +25,19 @@ def before_request():
|
|
23
25
|
|
24
26
|
@routes.teardown_request
|
25
27
|
def teardown_request(exception):
|
28
|
+
|
26
29
|
if "ping" not in flask.request.path:
|
27
30
|
utils_functions.decrement_request_counter(flask.current_app)
|
28
31
|
utils_functions.update_last_request_time(flask.current_app)
|
29
32
|
|
30
33
|
|
34
|
+
routes.register_blueprint(
|
35
|
+
blueprint_models.routes,
|
36
|
+
url_prefix=blueprint_models.routes.url_prefix,
|
37
|
+
name=blueprint_models.routes.name,
|
38
|
+
)
|
39
|
+
|
40
|
+
|
31
41
|
schemas = os.path.join(os.path.dirname(__file__), "schemas")
|
32
42
|
|
33
43
|
with open(
|
@@ -0,0 +1,74 @@
|
|
1
|
+
import json
|
2
|
+
import os
|
3
|
+
import xml.etree.ElementTree as ET
|
4
|
+
import flask
|
5
|
+
from ... import geode_functions, utils_functions
|
6
|
+
|
7
|
+
routes = flask.Blueprint("models", __name__, url_prefix="/models")
|
8
|
+
|
9
|
+
|
10
|
+
schemas = os.path.join(os.path.dirname(__file__), "schemas")
|
11
|
+
|
12
|
+
with open(os.path.join(schemas, "vtm_component_indices.json"), "r") as file:
|
13
|
+
vtm_component_indices_json = json.load(file)
|
14
|
+
|
15
|
+
|
16
|
+
@routes.route(
|
17
|
+
vtm_component_indices_json["route"], methods=vtm_component_indices_json["methods"]
|
18
|
+
)
|
19
|
+
def uuid_to_flat_index():
|
20
|
+
|
21
|
+
print(f"uuid_to_flat_index : {flask.request=}", flush=True)
|
22
|
+
utils_functions.validate_request(flask.request, vtm_component_indices_json)
|
23
|
+
vtm_file_path = os.path.join(
|
24
|
+
flask.current_app.config["DATA_FOLDER_PATH"], flask.request.json["id"] + ".vtm"
|
25
|
+
)
|
26
|
+
|
27
|
+
tree = ET.parse(vtm_file_path)
|
28
|
+
root = tree.getroot()
|
29
|
+
uuid_to_flat_index = {}
|
30
|
+
current_index = 1
|
31
|
+
|
32
|
+
for elem in root.iter():
|
33
|
+
if "uuid" in elem.attrib and elem.tag == "DataSet":
|
34
|
+
uuid_to_flat_index[elem.attrib["uuid"]] = current_index
|
35
|
+
current_index += 1
|
36
|
+
|
37
|
+
return flask.make_response(
|
38
|
+
{"uuid_to_flat_index": uuid_to_flat_index},
|
39
|
+
200,
|
40
|
+
)
|
41
|
+
|
42
|
+
|
43
|
+
def extract_model_uuids(geode_object, file_path):
|
44
|
+
model = geode_functions.load(geode_object, file_path)
|
45
|
+
mesh_components = model.mesh_components()
|
46
|
+
|
47
|
+
uuid_dict = {}
|
48
|
+
|
49
|
+
for mesh_component, ids in mesh_components.items():
|
50
|
+
component_name = mesh_component.get()
|
51
|
+
uuid_dict[component_name] = [id.string() for id in ids]
|
52
|
+
|
53
|
+
return uuid_dict
|
54
|
+
|
55
|
+
|
56
|
+
with open(os.path.join(schemas, "mesh_components.json"), "r") as file:
|
57
|
+
mesh_components_json = json.load(file)
|
58
|
+
|
59
|
+
|
60
|
+
@routes.route(mesh_components_json["route"], methods=mesh_components_json["methods"])
|
61
|
+
def extract_uuids_endpoint():
|
62
|
+
print(f"extract_uuids_endpoint : {flask.request=}", flush=True)
|
63
|
+
|
64
|
+
utils_functions.validate_request(flask.request, mesh_components_json)
|
65
|
+
|
66
|
+
file_path = os.path.join(
|
67
|
+
flask.current_app.config["DATA_FOLDER_PATH"], flask.request.json["filename"]
|
68
|
+
)
|
69
|
+
|
70
|
+
if not os.path.exists(file_path):
|
71
|
+
return flask.make_response({"error": "File not found"}, 404)
|
72
|
+
|
73
|
+
uuid_dict = extract_model_uuids(flask.request.json["geode_object"], file_path)
|
74
|
+
return flask.make_response({"uuid_dict": uuid_dict}, 200)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"route": "/mesh_components",
|
3
|
+
"methods": [
|
4
|
+
"POST"
|
5
|
+
],
|
6
|
+
"type": "object",
|
7
|
+
"properties": {
|
8
|
+
"filename": {
|
9
|
+
"type": "string"
|
10
|
+
},
|
11
|
+
"geode_object": {
|
12
|
+
"type": "string"
|
13
|
+
}
|
14
|
+
},
|
15
|
+
"required": [
|
16
|
+
"filename",
|
17
|
+
"geode_object"
|
18
|
+
],
|
19
|
+
"additionalProperties": false
|
20
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: OpenGeodeWeb-Back
|
3
|
-
Version: 5.
|
3
|
+
Version: 5.7.0
|
4
4
|
Summary: OpenGeodeWeb-Back is an open source framework that proposes handy python functions and wrappers for the OpenGeode ecosystem
|
5
5
|
Author-email: Geode-solutions <team-web@geode-solutions.com>
|
6
6
|
Project-URL: Homepage, https://github.com/Geode-solutions/OpenGeodeWeb-Back
|
@@ -15,30 +15,29 @@ Requires-Dist: asgiref==3.8.1
|
|
15
15
|
Requires-Dist: attrs==25.3.0
|
16
16
|
Requires-Dist: blinker==1.9.0
|
17
17
|
Requires-Dist: click==8.1.8
|
18
|
-
Requires-Dist: colorama==0.4.6
|
19
18
|
Requires-Dist: flask[async]==3.1.0
|
20
19
|
Requires-Dist: flask-cors==5.0.1
|
21
|
-
Requires-Dist: geode-background==9.
|
22
|
-
Requires-Dist: geode-common==33.7.
|
23
|
-
Requires-Dist: geode-conversion==6.2.
|
24
|
-
Requires-Dist: geode-explicit==6.1.
|
25
|
-
Requires-Dist: geode-implicit==3.7.
|
26
|
-
Requires-Dist: geode-numerics==6.0.
|
27
|
-
Requires-Dist: geode-simplex==9.2.
|
28
|
-
Requires-Dist: geode-viewables==3.
|
20
|
+
Requires-Dist: geode-background==9.2.3
|
21
|
+
Requires-Dist: geode-common==33.7.6
|
22
|
+
Requires-Dist: geode-conversion==6.2.11
|
23
|
+
Requires-Dist: geode-explicit==6.1.38
|
24
|
+
Requires-Dist: geode-implicit==3.7.8
|
25
|
+
Requires-Dist: geode-numerics==6.0.6
|
26
|
+
Requires-Dist: geode-simplex==9.2.8
|
27
|
+
Requires-Dist: geode-viewables==3.1.1
|
29
28
|
Requires-Dist: itsdangerous==2.2.0
|
30
29
|
Requires-Dist: jinja2==3.1.6
|
31
30
|
Requires-Dist: jsonschema==4.23.0
|
32
|
-
Requires-Dist: jsonschema-specifications==
|
31
|
+
Requires-Dist: jsonschema-specifications==2025.4.1
|
33
32
|
Requires-Dist: markupsafe==3.0.2
|
34
|
-
Requires-Dist: opengeode-core==15.17.
|
35
|
-
Requires-Dist: opengeode-geosciences==8.4.
|
36
|
-
Requires-Dist: opengeode-geosciencesio==5.3.
|
37
|
-
Requires-Dist: opengeode-inspector==6.
|
38
|
-
Requires-Dist: opengeode-io==7.
|
33
|
+
Requires-Dist: opengeode-core==15.17.14
|
34
|
+
Requires-Dist: opengeode-geosciences==8.4.6
|
35
|
+
Requires-Dist: opengeode-geosciencesio==5.3.9
|
36
|
+
Requires-Dist: opengeode-inspector==6.4.0
|
37
|
+
Requires-Dist: opengeode-io==7.2.0
|
39
38
|
Requires-Dist: referencing==0.36.2
|
40
39
|
Requires-Dist: rpds-py==0.24.0
|
41
|
-
Requires-Dist: typing-extensions==4.13.
|
40
|
+
Requires-Dist: typing-extensions==4.13.2
|
42
41
|
Requires-Dist: werkzeug==3.1.3
|
43
42
|
Dynamic: license-file
|
44
43
|
|
@@ -4,7 +4,10 @@ opengeodeweb_back/geode_functions.py,sha256=ei0eI3pWMqzrhgI5ta5HtnoRoNs-GCqtkXe5
|
|
4
4
|
opengeodeweb_back/geode_objects.py,sha256=4XH0TGujHw3LIBIzPLBa2eqxyfjVLo9hywKYxXEp-zU,24372
|
5
5
|
opengeodeweb_back/test_utils.py,sha256=gvRPOzin4nI5TKuB-AFgIxcekTOYM4h7yUYk0tYIZFI,820
|
6
6
|
opengeodeweb_back/utils_functions.py,sha256=otjE6XAZ_KXbaPipad3ivqFsTGGr8lqz1AhqPWgeE9g,4096
|
7
|
-
opengeodeweb_back/routes/blueprint_routes.py,sha256
|
7
|
+
opengeodeweb_back/routes/blueprint_routes.py,sha256=-LuLb-LEomF4i33Th2pgJGHDQ9Q-0rzA8uAdFYU3LvQ,14040
|
8
|
+
opengeodeweb_back/routes/models/blueprint_models.py,sha256=zH97zPB0bVtOtKWPNmY22d52zzp0rL8jho8wA0ku1Vo,2305
|
9
|
+
opengeodeweb_back/routes/models/schemas/mesh_components.json,sha256=3hgNqkxKDv691JGgjgMoqI_WgH2m7AtEFfjsOIqAz5Y,295
|
10
|
+
opengeodeweb_back/routes/models/schemas/vtm_component_indices.json,sha256=0km8gzawPj-eFodhaGzAgNZjAEOl4wLy24f_Bs3pBlw,217
|
8
11
|
opengeodeweb_back/routes/schemas/allowed_files.json,sha256=pRsGf39LiJpl3zEGLg4IqvRtm7iUx3Wq4Tb4tSFXGV0,234
|
9
12
|
opengeodeweb_back/routes/schemas/allowed_objects.json,sha256=oy_YYpFzgDICx-keWqNIUpQM3zzB4eE3H6mPNxH9rWc,361
|
10
13
|
opengeodeweb_back/routes/schemas/create_point.json,sha256=XjmXLMkr4jgWYHUKSwAhsxz1oLDZi8r8J0SY-QuEvks,386
|
@@ -19,8 +22,8 @@ opengeodeweb_back/routes/schemas/save_viewable_file.json,sha256=pvvEdaC7bNASPMrl
|
|
19
22
|
opengeodeweb_back/routes/schemas/texture_coordinates.json,sha256=m0EqxlvKojXVxK5Csucodu3rq1YMVJPwXJN_Wreb3qc,355
|
20
23
|
opengeodeweb_back/routes/schemas/upload_file.json,sha256=LJ3U3L5ApKuQDVFIpVT_y2alq4HW_suTvZ3HUucNbhg,219
|
21
24
|
opengeodeweb_back/routes/schemas/vertex_attribute_names.json,sha256=bya9KGtTmHFWjD-ur0_0UAY2yf3KkMeuNrk6E1UkjLM,358
|
22
|
-
opengeodeweb_back-5.
|
23
|
-
opengeodeweb_back-5.
|
24
|
-
opengeodeweb_back-5.
|
25
|
-
opengeodeweb_back-5.
|
26
|
-
opengeodeweb_back-5.
|
25
|
+
opengeodeweb_back-5.7.0.dist-info/licenses/LICENSE,sha256=LoTB-aqQvzTGxoTRXNnhNV0LKiqdk2bQv6MB34l8zkI,1079
|
26
|
+
opengeodeweb_back-5.7.0.dist-info/METADATA,sha256=qXESLTR-rkma58kAHm_Sd1j5wiMLbEe1odv22pCKGuM,3077
|
27
|
+
opengeodeweb_back-5.7.0.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
|
28
|
+
opengeodeweb_back-5.7.0.dist-info/top_level.txt,sha256=tN1FZeLIVBrdja2-pbmhg5-tK-JILmmT9OeIBnhlUrQ,18
|
29
|
+
opengeodeweb_back-5.7.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|