goodmap 0.4.4__py3-none-any.whl → 0.5.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.
- goodmap/core_api.py +0 -25
- goodmap/data_validator.py +1 -1
- {goodmap-0.4.4.dist-info → goodmap-0.5.0.dist-info}/METADATA +2 -2
- {goodmap-0.4.4.dist-info → goodmap-0.5.0.dist-info}/RECORD +6 -6
- {goodmap-0.4.4.dist-info → goodmap-0.5.0.dist-info}/WHEEL +1 -1
- {goodmap-0.4.4.dist-info → goodmap-0.5.0.dist-info}/LICENSE.md +0 -0
goodmap/core_api.py
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import importlib.metadata
|
|
2
2
|
import uuid
|
|
3
3
|
|
|
4
|
-
import deprecation
|
|
5
4
|
from flask import Blueprint, jsonify, make_response, request
|
|
6
5
|
from flask_babel import gettext
|
|
7
6
|
from flask_restx import Api, Resource, fields
|
|
8
7
|
from platzky.config import LanguagesMapping
|
|
9
8
|
|
|
10
|
-
from goodmap.core import get_queried_data
|
|
11
9
|
from goodmap.formatter import prepare_pin
|
|
12
10
|
|
|
13
11
|
|
|
@@ -76,29 +74,6 @@ def core_pages(
|
|
|
76
74
|
return make_response(jsonify({"message": f"{error_message} : {e}"}), 400)
|
|
77
75
|
return make_response(jsonify({"message": gettext("Location reported")}), 200)
|
|
78
76
|
|
|
79
|
-
@core_api.route("/data")
|
|
80
|
-
class Data(Resource):
|
|
81
|
-
@deprecation.deprecated(
|
|
82
|
-
deprecated_in="0.4.1",
|
|
83
|
-
removed_in="0.5.0",
|
|
84
|
-
current_version=importlib.metadata.version("goodmap"),
|
|
85
|
-
details="Use /locations or /location/<point_id> instead",
|
|
86
|
-
)
|
|
87
|
-
def get(self):
|
|
88
|
-
"""
|
|
89
|
-
Shows all data filtered by query parameters
|
|
90
|
-
e.g. /api/data?category=category1&category=category2
|
|
91
|
-
"""
|
|
92
|
-
all_data = database.get_data()
|
|
93
|
-
query_params = request.args.to_dict(flat=False)
|
|
94
|
-
data = all_data["data"]
|
|
95
|
-
categories = all_data["categories"]
|
|
96
|
-
visible_data = all_data["visible_data"]
|
|
97
|
-
meta_data = all_data["meta_data"]
|
|
98
|
-
queried_data = get_queried_data(data, categories, query_params)
|
|
99
|
-
formatted_data = [prepare_pin(x, visible_data, meta_data) for x in queried_data]
|
|
100
|
-
return jsonify(formatted_data)
|
|
101
|
-
|
|
102
77
|
@core_api.route("/locations")
|
|
103
78
|
class GetLocations(Resource):
|
|
104
79
|
def get(self):
|
goodmap/data_validator.py
CHANGED
|
@@ -50,7 +50,7 @@ def get_invalid_value_in_category_violations(p, categories):
|
|
|
50
50
|
for category in categories & p.keys():
|
|
51
51
|
category_value_in_point = p[category]
|
|
52
52
|
valid_values_set = categories[category]
|
|
53
|
-
if
|
|
53
|
+
if isinstance(category_value_in_point, list):
|
|
54
54
|
for attribute_value in category_value_in_point:
|
|
55
55
|
if attribute_value not in valid_values_set:
|
|
56
56
|
violations.append(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: goodmap
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: Map engine to serve all the people :)
|
|
5
5
|
Author: Krzysztof Kolodzinski
|
|
6
6
|
Author-email: krzysztof.kolodzinski@problematy.pl
|
|
@@ -22,7 +22,7 @@ Requires-Dist: google-cloud-storage (>=2.7.0,<3.0.0)
|
|
|
22
22
|
Requires-Dist: gql (>=3.4.0,<4.0.0)
|
|
23
23
|
Requires-Dist: gunicorn (>=20.1.0,<21.0.0)
|
|
24
24
|
Requires-Dist: humanize (>=4.6.0,<5.0.0)
|
|
25
|
-
Requires-Dist: platzky (>=0.
|
|
25
|
+
Requires-Dist: platzky (>=0.3.1,<0.4.0)
|
|
26
26
|
Requires-Dist: pydantic (>=2.7.1,<3.0.0)
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
goodmap/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
2
2
|
goodmap/core.py,sha256=rzMhOIYnR1jxTX6uHQJKIPLYxdUm4_v2d6LrtHtJpHU,1465
|
|
3
|
-
goodmap/core_api.py,sha256=
|
|
3
|
+
goodmap/core_api.py,sha256=9rF7eBsHvkAYtho-UWYdqMQ96z9Gh8n2hJDMX9lXZDM,5507
|
|
4
4
|
goodmap/data_models/location.py,sha256=ESR4Z_zINIjldJKhlXImMaQrdtUPJBQc6SatpPPJyNQ,1054
|
|
5
|
-
goodmap/data_validator.py,sha256=
|
|
5
|
+
goodmap/data_validator.py,sha256=lBmVAPxvSmEOdUGeVYSjUvVVmKfPyq4CWoHfczTtEMM,4090
|
|
6
6
|
goodmap/db.py,sha256=AJHUP3n29BRjgt6GoGnPtxLNg5TL-KSJhtSZtsZKmGM,3665
|
|
7
7
|
goodmap/formatter.py,sha256=VlUHcK1HtM_IEU0VE3S5TOkZLVheMdakvUeW2tCKdq0,783
|
|
8
8
|
goodmap/goodmap.py,sha256=cPTTyGqajuza3RDlfFuCl8idxy7TFo6LPuANP8hmg7U,1806
|
|
9
9
|
goodmap/templates/admin.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
goodmap/templates/map.html,sha256=llzzfWGHM0Xtr4Io05QJLCLajySHNBzKejR0Km5nGMw,3926
|
|
11
|
-
goodmap-0.
|
|
12
|
-
goodmap-0.
|
|
13
|
-
goodmap-0.
|
|
14
|
-
goodmap-0.
|
|
11
|
+
goodmap-0.5.0.dist-info/LICENSE.md,sha256=nkCQOR7uheLRvHRfXmwx9LhBnMcPeBU9d4ebLojDiQU,1067
|
|
12
|
+
goodmap-0.5.0.dist-info/METADATA,sha256=pRKGRufpDkMBOHotyZ6SYEyD7iUIeFDnDCuYIpStyQI,4525
|
|
13
|
+
goodmap-0.5.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
|
14
|
+
goodmap-0.5.0.dist-info/RECORD,,
|
|
File without changes
|