From bbc1c2e128109238188f9aaae484b1f4be011dc1 Mon Sep 17 00:00:00 2001 From: Mark Tully Date: Tue, 21 Oct 2025 21:21:53 +0100 Subject: [PATCH 1/2] Move api v1 and v2 related files into their own directories --- entityshape/{ => api_v1}/api_v1_blueprint.py | 4 ++-- entityshape/{ => api_v1}/compareshape.py | 0 entityshape/{ => api_v1}/shape.py | 0 entityshape/{ => api_v2}/api_v2_blueprint.py | 4 ++-- entityshape/{ => api_v2}/comparejsonld.py | 4 ++-- entityshape/{ => api_v2}/compareproperties.py | 2 +- entityshape/{ => api_v2}/comparestatements.py | 2 +- entityshape/{ => api_v2}/getjsonld.py | 0 entityshape/{ => api_v2}/utilities.py | 0 entityshape/app.py | 4 ++-- tests/test_compare_properties.py | 2 +- tests/test_compare_statements.py | 2 +- tests/test_jsonld.py | 8 ++++---- tests/test_utilities.py | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) rename entityshape/{ => api_v1}/api_v1_blueprint.py (95%) rename entityshape/{ => api_v1}/compareshape.py (100%) rename entityshape/{ => api_v1}/shape.py (100%) rename entityshape/{ => api_v2}/api_v2_blueprint.py (95%) rename entityshape/{ => api_v2}/comparejsonld.py (98%) rename entityshape/{ => api_v2}/compareproperties.py (99%) rename entityshape/{ => api_v2}/comparestatements.py (98%) rename entityshape/{ => api_v2}/getjsonld.py (100%) rename entityshape/{ => api_v2}/utilities.py (100%) diff --git a/entityshape/api_v1_blueprint.py b/entityshape/api_v1/api_v1_blueprint.py similarity index 95% rename from entityshape/api_v1_blueprint.py rename to entityshape/api_v1/api_v1_blueprint.py index e9f1fac..8b77425 100644 --- a/entityshape/api_v1_blueprint.py +++ b/entityshape/api_v1/api_v1_blueprint.py @@ -1,7 +1,7 @@ from flask import Blueprint, request, json, Response -from entityshape.shape import Shape -from entityshape.compareshape import CompareShape +from api_v1.shape import Shape +from api_v1.compareshape import CompareShape api_v1 = Blueprint('api_v1', __name__,) diff --git a/entityshape/compareshape.py b/entityshape/api_v1/compareshape.py similarity index 100% rename from entityshape/compareshape.py rename to entityshape/api_v1/compareshape.py diff --git a/entityshape/shape.py b/entityshape/api_v1/shape.py similarity index 100% rename from entityshape/shape.py rename to entityshape/api_v1/shape.py diff --git a/entityshape/api_v2_blueprint.py b/entityshape/api_v2/api_v2_blueprint.py similarity index 95% rename from entityshape/api_v2_blueprint.py rename to entityshape/api_v2/api_v2_blueprint.py index 41ec5e4..3e2cdd3 100644 --- a/entityshape/api_v2_blueprint.py +++ b/entityshape/api_v2/api_v2_blueprint.py @@ -1,7 +1,7 @@ from flask import Blueprint, request, json, Response -from entityshape.getjsonld import JSONLDShape -from entityshape.comparejsonld import CompareJSONLD +from api_v2.getjsonld import JSONLDShape +from api_v2.comparejsonld import CompareJSONLD api_v2 = Blueprint('api_v2', __name__,) diff --git a/entityshape/comparejsonld.py b/entityshape/api_v2/comparejsonld.py similarity index 98% rename from entityshape/comparejsonld.py rename to entityshape/api_v2/comparejsonld.py index 3b5866c..c1bd451 100644 --- a/entityshape/comparejsonld.py +++ b/entityshape/api_v2/comparejsonld.py @@ -7,8 +7,8 @@ import requests from requests import Response -from entityshape.compareproperties import CompareProperties -from entityshape.comparestatements import CompareStatements +from api_v2.compareproperties import CompareProperties +from api_v2.comparestatements import CompareStatements class CompareJSONLD: diff --git a/entityshape/compareproperties.py b/entityshape/api_v2/compareproperties.py similarity index 99% rename from entityshape/compareproperties.py rename to entityshape/api_v2/compareproperties.py index 577e6af..22a9acd 100644 --- a/entityshape/compareproperties.py +++ b/entityshape/api_v2/compareproperties.py @@ -1,4 +1,4 @@ -from entityshape.utilities import Utilities +from api_v2.utilities import Utilities class CompareProperties: diff --git a/entityshape/comparestatements.py b/entityshape/api_v2/comparestatements.py similarity index 98% rename from entityshape/comparestatements.py rename to entityshape/api_v2/comparestatements.py index 64f903b..022f685 100644 --- a/entityshape/comparestatements.py +++ b/entityshape/api_v2/comparestatements.py @@ -1,6 +1,6 @@ from typing import Tuple, Any -from entityshape.utilities import Utilities +from api_v2.utilities import Utilities class CompareStatements: diff --git a/entityshape/getjsonld.py b/entityshape/api_v2/getjsonld.py similarity index 100% rename from entityshape/getjsonld.py rename to entityshape/api_v2/getjsonld.py diff --git a/entityshape/utilities.py b/entityshape/api_v2/utilities.py similarity index 100% rename from entityshape/utilities.py rename to entityshape/api_v2/utilities.py diff --git a/entityshape/app.py b/entityshape/app.py index 3f28307..b9daaf8 100644 --- a/entityshape/app.py +++ b/entityshape/app.py @@ -4,8 +4,8 @@ from flask import Flask from flask_cors import CORS -from entityshape.api_v1_blueprint import api_v1 -from entityshape.api_v2_blueprint import api_v2 +from api_v1.api_v1_blueprint import api_v1 +from api_v2.api_v2_blueprint import api_v2 app = Flask(__name__) CORS(app) diff --git a/tests/test_compare_properties.py b/tests/test_compare_properties.py index e530191..31a5bc7 100644 --- a/tests/test_compare_properties.py +++ b/tests/test_compare_properties.py @@ -1,6 +1,6 @@ import unittest -from entityshape.comparejsonld import CompareProperties +from api_v2.comparejsonld import CompareProperties class TestCompareProperties(unittest.TestCase): diff --git a/tests/test_compare_statements.py b/tests/test_compare_statements.py index b34f24c..a059877 100644 --- a/tests/test_compare_statements.py +++ b/tests/test_compare_statements.py @@ -1,6 +1,6 @@ import unittest -from entityshape.comparejsonld import CompareStatements +from api_v2.comparejsonld import CompareStatements class TestCompareStatements(unittest.TestCase): diff --git a/tests/test_jsonld.py b/tests/test_jsonld.py index e3845c9..7bf6236 100644 --- a/tests/test_jsonld.py +++ b/tests/test_jsonld.py @@ -3,10 +3,10 @@ """ import unittest -from entityshape.comparejsonld import CompareJSONLD -from entityshape.compareshape import CompareShape -from entityshape.shape import Shape -from entityshape.getjsonld import JSONLDShape +from api_v2.comparejsonld import CompareJSONLD +from api_v1.compareshape import CompareShape +from api_v1.shape import Shape +from api_v2.getjsonld import JSONLDShape class JSONLDCase(unittest.TestCase): diff --git a/tests/test_utilities.py b/tests/test_utilities.py index 9c08fbf..b11073f 100644 --- a/tests/test_utilities.py +++ b/tests/test_utilities.py @@ -1,6 +1,6 @@ import unittest -from entityshape.utilities import Utilities +from api_v2.utilities import Utilities class UtilitiesTests(unittest.TestCase): From 51253059bc290461f0c34881ee5caf1533bb671d Mon Sep 17 00:00:00 2001 From: Mark Tully Date: Tue, 21 Oct 2025 21:49:47 +0100 Subject: [PATCH 2/2] Fix imports --- entityshape/api_v1/api_v1_blueprint.py | 4 ++-- entityshape/api_v2/api_v2_blueprint.py | 4 ++-- entityshape/api_v2/comparejsonld.py | 4 ++-- entityshape/api_v2/compareproperties.py | 2 +- entityshape/api_v2/comparestatements.py | 2 +- entityshape/app.py | 4 ++-- tests/test_compare_properties.py | 2 +- tests/test_compare_statements.py | 2 +- tests/test_jsonld.py | 8 ++++---- tests/test_utilities.py | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/entityshape/api_v1/api_v1_blueprint.py b/entityshape/api_v1/api_v1_blueprint.py index 8b77425..ca9e2ca 100644 --- a/entityshape/api_v1/api_v1_blueprint.py +++ b/entityshape/api_v1/api_v1_blueprint.py @@ -1,7 +1,7 @@ from flask import Blueprint, request, json, Response -from api_v1.shape import Shape -from api_v1.compareshape import CompareShape +from entityshape.api_v1.shape import Shape +from entityshape.api_v1.compareshape import CompareShape api_v1 = Blueprint('api_v1', __name__,) diff --git a/entityshape/api_v2/api_v2_blueprint.py b/entityshape/api_v2/api_v2_blueprint.py index 3e2cdd3..b6384da 100644 --- a/entityshape/api_v2/api_v2_blueprint.py +++ b/entityshape/api_v2/api_v2_blueprint.py @@ -1,7 +1,7 @@ from flask import Blueprint, request, json, Response -from api_v2.getjsonld import JSONLDShape -from api_v2.comparejsonld import CompareJSONLD +from entityshape.api_v2.getjsonld import JSONLDShape +from entityshape.api_v2.comparejsonld import CompareJSONLD api_v2 = Blueprint('api_v2', __name__,) diff --git a/entityshape/api_v2/comparejsonld.py b/entityshape/api_v2/comparejsonld.py index c1bd451..a8c74ff 100644 --- a/entityshape/api_v2/comparejsonld.py +++ b/entityshape/api_v2/comparejsonld.py @@ -7,8 +7,8 @@ import requests from requests import Response -from api_v2.compareproperties import CompareProperties -from api_v2.comparestatements import CompareStatements +from entityshape.api_v2.compareproperties import CompareProperties +from entityshape.api_v2.comparestatements import CompareStatements class CompareJSONLD: diff --git a/entityshape/api_v2/compareproperties.py b/entityshape/api_v2/compareproperties.py index 22a9acd..35de1fa 100644 --- a/entityshape/api_v2/compareproperties.py +++ b/entityshape/api_v2/compareproperties.py @@ -1,4 +1,4 @@ -from api_v2.utilities import Utilities +from entityshape.api_v2.utilities import Utilities class CompareProperties: diff --git a/entityshape/api_v2/comparestatements.py b/entityshape/api_v2/comparestatements.py index 022f685..263efa9 100644 --- a/entityshape/api_v2/comparestatements.py +++ b/entityshape/api_v2/comparestatements.py @@ -1,6 +1,6 @@ from typing import Tuple, Any -from api_v2.utilities import Utilities +from entityshape.api_v2.utilities import Utilities class CompareStatements: diff --git a/entityshape/app.py b/entityshape/app.py index b9daaf8..2020082 100644 --- a/entityshape/app.py +++ b/entityshape/app.py @@ -4,8 +4,8 @@ from flask import Flask from flask_cors import CORS -from api_v1.api_v1_blueprint import api_v1 -from api_v2.api_v2_blueprint import api_v2 +from entityshape.api_v1.api_v1_blueprint import api_v1 +from entityshape.api_v2.api_v2_blueprint import api_v2 app = Flask(__name__) CORS(app) diff --git a/tests/test_compare_properties.py b/tests/test_compare_properties.py index 31a5bc7..e045694 100644 --- a/tests/test_compare_properties.py +++ b/tests/test_compare_properties.py @@ -1,6 +1,6 @@ import unittest -from api_v2.comparejsonld import CompareProperties +from entityshape.api_v2.comparejsonld import CompareProperties class TestCompareProperties(unittest.TestCase): diff --git a/tests/test_compare_statements.py b/tests/test_compare_statements.py index a059877..121196b 100644 --- a/tests/test_compare_statements.py +++ b/tests/test_compare_statements.py @@ -1,6 +1,6 @@ import unittest -from api_v2.comparejsonld import CompareStatements +from entityshape.api_v2.comparejsonld import CompareStatements class TestCompareStatements(unittest.TestCase): diff --git a/tests/test_jsonld.py b/tests/test_jsonld.py index 7bf6236..37c69b3 100644 --- a/tests/test_jsonld.py +++ b/tests/test_jsonld.py @@ -3,10 +3,10 @@ """ import unittest -from api_v2.comparejsonld import CompareJSONLD -from api_v1.compareshape import CompareShape -from api_v1.shape import Shape -from api_v2.getjsonld import JSONLDShape +from entityshape.api_v2.comparejsonld import CompareJSONLD +from entityshape.api_v1.compareshape import CompareShape +from entityshape.api_v1.shape import Shape +from entityshape.api_v2.getjsonld import JSONLDShape class JSONLDCase(unittest.TestCase): diff --git a/tests/test_utilities.py b/tests/test_utilities.py index b11073f..1b4bde3 100644 --- a/tests/test_utilities.py +++ b/tests/test_utilities.py @@ -1,6 +1,6 @@ import unittest -from api_v2.utilities import Utilities +from entityshape.api_v2.utilities import Utilities class UtilitiesTests(unittest.TestCase):