OpenGeodeWeb-Back 5.6.6rc1__py3-none-any.whl → 5.7.0rc1__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.
@@ -12,7 +12,9 @@ import werkzeug
12
12
  # Local application imports
13
13
  from .. import geode_functions, utils_functions
14
14
 
15
- routes = flask.Blueprint("routes", __name__)
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: OpenGeodeWeb-Back
3
- Version: 5.6.6rc1
3
+ Version: 5.7.0rc1
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.1.3
22
- Requires-Dist: geode-common==33.7.0
23
- Requires-Dist: geode-conversion==6.2.6
24
- Requires-Dist: geode-explicit==6.1.34
25
- Requires-Dist: geode-implicit==3.7.3
26
- Requires-Dist: geode-numerics==6.0.2
27
- Requires-Dist: geode-simplex==9.2.3
28
- Requires-Dist: geode-viewables==3.0.12
20
+ Requires-Dist: geode-background==9.2.0
21
+ Requires-Dist: geode-common==33.7.5
22
+ Requires-Dist: geode-conversion==6.2.9
23
+ Requires-Dist: geode-explicit==6.1.37
24
+ Requires-Dist: geode-implicit==3.7.6
25
+ Requires-Dist: geode-numerics==6.0.3
26
+ Requires-Dist: geode-simplex==9.2.6
27
+ Requires-Dist: geode-viewables==3.1.0
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
31
  Requires-Dist: jsonschema-specifications==2024.10.1
33
32
  Requires-Dist: markupsafe==3.0.2
34
- Requires-Dist: opengeode-core==15.17.7
35
- Requires-Dist: opengeode-geosciences==8.4.3
33
+ Requires-Dist: opengeode-core==15.17.12
34
+ Requires-Dist: opengeode-geosciences==8.4.4
36
35
  Requires-Dist: opengeode-geosciencesio==5.3.8
37
36
  Requires-Dist: opengeode-inspector==6.3.11
38
37
  Requires-Dist: opengeode-io==7.1.5
39
38
  Requires-Dist: referencing==0.36.2
40
39
  Requires-Dist: rpds-py==0.24.0
41
- Requires-Dist: typing-extensions==4.13.1
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,8 @@ 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=oDhoXIX5XIaaRa-_CEphwRmIxhuUYOS2spB2i1zOc8k,13818
7
+ opengeodeweb_back/routes/blueprint_routes.py,sha256=-LuLb-LEomF4i33Th2pgJGHDQ9Q-0rzA8uAdFYU3LvQ,14040
8
+ opengeodeweb_back/routes/models/blueprint_models.py,sha256=zH97zPB0bVtOtKWPNmY22d52zzp0rL8jho8wA0ku1Vo,2305
8
9
  opengeodeweb_back/routes/schemas/allowed_files.json,sha256=pRsGf39LiJpl3zEGLg4IqvRtm7iUx3Wq4Tb4tSFXGV0,234
9
10
  opengeodeweb_back/routes/schemas/allowed_objects.json,sha256=oy_YYpFzgDICx-keWqNIUpQM3zzB4eE3H6mPNxH9rWc,361
10
11
  opengeodeweb_back/routes/schemas/create_point.json,sha256=XjmXLMkr4jgWYHUKSwAhsxz1oLDZi8r8J0SY-QuEvks,386
@@ -19,8 +20,8 @@ opengeodeweb_back/routes/schemas/save_viewable_file.json,sha256=pvvEdaC7bNASPMrl
19
20
  opengeodeweb_back/routes/schemas/texture_coordinates.json,sha256=m0EqxlvKojXVxK5Csucodu3rq1YMVJPwXJN_Wreb3qc,355
20
21
  opengeodeweb_back/routes/schemas/upload_file.json,sha256=LJ3U3L5ApKuQDVFIpVT_y2alq4HW_suTvZ3HUucNbhg,219
21
22
  opengeodeweb_back/routes/schemas/vertex_attribute_names.json,sha256=bya9KGtTmHFWjD-ur0_0UAY2yf3KkMeuNrk6E1UkjLM,358
22
- opengeodeweb_back-5.6.6rc1.dist-info/licenses/LICENSE,sha256=LoTB-aqQvzTGxoTRXNnhNV0LKiqdk2bQv6MB34l8zkI,1079
23
- opengeodeweb_back-5.6.6rc1.dist-info/METADATA,sha256=e-djt0CPuQkbWzUwMW-i452o3WmUgC-qco7INeYI1QQ,3112
24
- opengeodeweb_back-5.6.6rc1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
25
- opengeodeweb_back-5.6.6rc1.dist-info/top_level.txt,sha256=tN1FZeLIVBrdja2-pbmhg5-tK-JILmmT9OeIBnhlUrQ,18
26
- opengeodeweb_back-5.6.6rc1.dist-info/RECORD,,
23
+ opengeodeweb_back-5.7.0rc1.dist-info/licenses/LICENSE,sha256=LoTB-aqQvzTGxoTRXNnhNV0LKiqdk2bQv6MB34l8zkI,1079
24
+ opengeodeweb_back-5.7.0rc1.dist-info/METADATA,sha256=XK55oDmc4a_5bUbrLQju116x8edggDul0sKQlShgjQk,3081
25
+ opengeodeweb_back-5.7.0rc1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
26
+ opengeodeweb_back-5.7.0rc1.dist-info/top_level.txt,sha256=tN1FZeLIVBrdja2-pbmhg5-tK-JILmmT9OeIBnhlUrQ,18
27
+ opengeodeweb_back-5.7.0rc1.dist-info/RECORD,,