mapillary-tools 0.14.1__py3-none-any.whl → 0.14.2__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.
- mapillary_tools/__init__.py +1 -1
- mapillary_tools/authenticate.py +1 -1
- mapillary_tools/config.py +5 -0
- mapillary_tools/geotag/options.py +4 -1
- mapillary_tools/process_geotag_properties.py +4 -11
- mapillary_tools/serializer/description.py +12 -2
- mapillary_tools/upload.py +1 -2
- mapillary_tools/uploader.py +8 -0
- {mapillary_tools-0.14.1.dist-info → mapillary_tools-0.14.2.dist-info}/METADATA +1 -1
- {mapillary_tools-0.14.1.dist-info → mapillary_tools-0.14.2.dist-info}/RECORD +14 -14
- {mapillary_tools-0.14.1.dist-info → mapillary_tools-0.14.2.dist-info}/WHEEL +0 -0
- {mapillary_tools-0.14.1.dist-info → mapillary_tools-0.14.2.dist-info}/entry_points.txt +0 -0
- {mapillary_tools-0.14.1.dist-info → mapillary_tools-0.14.2.dist-info}/licenses/LICENSE +0 -0
- {mapillary_tools-0.14.1.dist-info → mapillary_tools-0.14.2.dist-info}/top_level.txt +0 -0
mapillary_tools/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION = "0.14.
|
|
1
|
+
VERSION = "0.14.2"
|
mapillary_tools/authenticate.py
CHANGED
|
@@ -165,7 +165,7 @@ def _prompt(message: str) -> str:
|
|
|
165
165
|
|
|
166
166
|
def _validate_profile(user_items: config.UserItem) -> config.UserItem:
|
|
167
167
|
try:
|
|
168
|
-
|
|
168
|
+
config.UserItemSchemaValidator.validate(user_items)
|
|
169
169
|
except jsonschema.ValidationError as ex:
|
|
170
170
|
raise exceptions.MapillaryBadParameterError(
|
|
171
171
|
f"Invalid profile format: {ex.message}"
|
mapillary_tools/config.py
CHANGED
|
@@ -6,6 +6,8 @@ import sys
|
|
|
6
6
|
import typing as T
|
|
7
7
|
from typing import TypedDict
|
|
8
8
|
|
|
9
|
+
import jsonschema
|
|
10
|
+
|
|
9
11
|
if sys.version_info >= (3, 11):
|
|
10
12
|
from typing import Required
|
|
11
13
|
else:
|
|
@@ -50,6 +52,9 @@ UserItemSchema = {
|
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
|
|
55
|
+
UserItemSchemaValidator = jsonschema.Draft202012Validator(UserItemSchema)
|
|
56
|
+
|
|
57
|
+
|
|
53
58
|
def _load_config(config_path: str) -> configparser.ConfigParser:
|
|
54
59
|
config = configparser.ConfigParser()
|
|
55
60
|
# Override to not change option names (by default it will lower them)
|
|
@@ -173,8 +173,11 @@ SourceOptionSchema = {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
|
|
176
|
+
SourceOptionSchemaValidator = jsonschema.Draft202012Validator(SourceOptionSchema)
|
|
177
|
+
|
|
178
|
+
|
|
176
179
|
def validate_option(instance):
|
|
177
|
-
|
|
180
|
+
SourceOptionSchemaValidator.validate(instance=instance)
|
|
178
181
|
|
|
179
182
|
|
|
180
183
|
if __name__ == "__main__":
|
|
@@ -304,19 +304,12 @@ def _validate_metadatas(
|
|
|
304
304
|
# TypeError: __init__() missing 3 required positional arguments: 'image_time', 'gpx_start_time', and 'gpx_end_time'
|
|
305
305
|
# See https://stackoverflow.com/a/61432070
|
|
306
306
|
good_metadatas, error_metadatas = types.separate_errors(metadatas)
|
|
307
|
-
map_results = utils.mp_map_maybe(
|
|
308
|
-
validate_and_fail_metadata,
|
|
309
|
-
T.cast(T.Iterable[types.Metadata], good_metadatas),
|
|
310
|
-
num_processes=num_processes,
|
|
311
|
-
)
|
|
312
307
|
|
|
313
308
|
validated_metadatas = list(
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
disable=LOG.getEffectiveLevel() <= logging.DEBUG,
|
|
319
|
-
total=len(good_metadatas),
|
|
309
|
+
utils.mp_map_maybe(
|
|
310
|
+
validate_and_fail_metadata,
|
|
311
|
+
T.cast(T.Iterable[types.Metadata], good_metadatas),
|
|
312
|
+
num_processes=num_processes,
|
|
320
313
|
)
|
|
321
314
|
)
|
|
322
315
|
|
|
@@ -259,6 +259,11 @@ ImageDescriptionFileSchema = _merge_schema(
|
|
|
259
259
|
)
|
|
260
260
|
|
|
261
261
|
|
|
262
|
+
ImageDescriptionFileSchemaValidator = jsonschema.Draft202012Validator(
|
|
263
|
+
ImageDescriptionFileSchema
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
|
|
262
267
|
VideoDescriptionFileSchema = _merge_schema(
|
|
263
268
|
VideoDescriptionSchema,
|
|
264
269
|
{
|
|
@@ -295,6 +300,11 @@ VideoDescriptionFileSchema = _merge_schema(
|
|
|
295
300
|
)
|
|
296
301
|
|
|
297
302
|
|
|
303
|
+
VideoDescriptionFileSchemaValidator = jsonschema.Draft202012Validator(
|
|
304
|
+
VideoDescriptionFileSchema
|
|
305
|
+
)
|
|
306
|
+
|
|
307
|
+
|
|
298
308
|
ImageVideoDescriptionFileSchema = {
|
|
299
309
|
"oneOf": [VideoDescriptionFileSchema, ImageDescriptionFileSchema]
|
|
300
310
|
}
|
|
@@ -520,7 +530,7 @@ def parse_capture_time(time: str) -> datetime.datetime:
|
|
|
520
530
|
|
|
521
531
|
def validate_image_desc(desc: T.Any) -> None:
|
|
522
532
|
try:
|
|
523
|
-
|
|
533
|
+
ImageDescriptionFileSchemaValidator.validate(desc)
|
|
524
534
|
except jsonschema.ValidationError as ex:
|
|
525
535
|
# do not use str(ex) which is more verbose
|
|
526
536
|
raise exceptions.MapillaryMetadataValidationError(ex.message) from ex
|
|
@@ -533,7 +543,7 @@ def validate_image_desc(desc: T.Any) -> None:
|
|
|
533
543
|
|
|
534
544
|
def validate_video_desc(desc: T.Any) -> None:
|
|
535
545
|
try:
|
|
536
|
-
|
|
546
|
+
VideoDescriptionFileSchemaValidator.validate(desc)
|
|
537
547
|
except jsonschema.ValidationError as ex:
|
|
538
548
|
# do not use str(ex) which is more verbose
|
|
539
549
|
raise exceptions.MapillaryMetadataValidationError(ex.message) from ex
|
mapillary_tools/upload.py
CHANGED
|
@@ -10,7 +10,6 @@ import uuid
|
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
|
|
12
12
|
import humanize
|
|
13
|
-
import jsonschema
|
|
14
13
|
import requests
|
|
15
14
|
from tqdm import tqdm
|
|
16
15
|
|
|
@@ -57,7 +56,7 @@ def upload(
|
|
|
57
56
|
|
|
58
57
|
metadatas = _load_descs(_metadatas_from_process, import_paths, desc_path)
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
config.UserItemSchemaValidator.validate(user_items)
|
|
61
60
|
|
|
62
61
|
# Setup the emitter -- the order matters here
|
|
63
62
|
|
mapillary_tools/uploader.py
CHANGED
|
@@ -36,6 +36,7 @@ from . import (
|
|
|
36
36
|
types,
|
|
37
37
|
upload_api_v4,
|
|
38
38
|
utils,
|
|
39
|
+
VERSION,
|
|
39
40
|
)
|
|
40
41
|
from .camm import camm_builder, camm_parser
|
|
41
42
|
from .gpmf import gpmf_parser
|
|
@@ -799,8 +800,14 @@ class SingleImageUploader:
|
|
|
799
800
|
LOG.debug("Dry-run mode enabled, skipping caching upload file handles")
|
|
800
801
|
return None
|
|
801
802
|
|
|
803
|
+
# Different python/CLI versions use different cache (dbm) formats.
|
|
804
|
+
# Separate them to avoid conflicts
|
|
805
|
+
py_version_parts = [str(part) for part in sys.version_info[:3]]
|
|
806
|
+
version = f"py_{'_'.join(py_version_parts)}_{VERSION}"
|
|
807
|
+
|
|
802
808
|
cache_path_dir = (
|
|
803
809
|
Path(constants.UPLOAD_CACHE_DIR)
|
|
810
|
+
.joinpath(version)
|
|
804
811
|
.joinpath(api_v4.MAPILLARY_CLIENT_TOKEN.replace("|", "_"))
|
|
805
812
|
.joinpath(
|
|
806
813
|
user_items.get("MAPSettingsUserKey", user_items["user_upload_token"])
|
|
@@ -812,6 +819,7 @@ class SingleImageUploader:
|
|
|
812
819
|
# Sanitize sensitive segments for logging
|
|
813
820
|
sanitized_cache_path = (
|
|
814
821
|
Path(constants.UPLOAD_CACHE_DIR)
|
|
822
|
+
.joinpath(version)
|
|
815
823
|
.joinpath("***")
|
|
816
824
|
.joinpath("***")
|
|
817
825
|
.joinpath("cached_file_handles")
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
mapillary_tools/__init__.py,sha256=
|
|
1
|
+
mapillary_tools/__init__.py,sha256=qdi1NvyXrEYAkFGfNSU2jMM-Ua-ehuWizcwvW341obw,19
|
|
2
2
|
mapillary_tools/api_v4.py,sha256=bckAU_atUs0pSuqySeY4W0Rs011a21ClJHo_mbbcXXw,4864
|
|
3
|
-
mapillary_tools/authenticate.py,sha256=
|
|
3
|
+
mapillary_tools/authenticate.py,sha256=mmaOwjQ444DcX4lRw2ms3naBg5Y_xwIJAIWeVdsQfqM,11742
|
|
4
4
|
mapillary_tools/blackvue_parser.py,sha256=ea2JtU9MWU6yB0bQlF970_Of0bJVofSTRq1P30WKW-0,5623
|
|
5
|
-
mapillary_tools/config.py,sha256=
|
|
5
|
+
mapillary_tools/config.py,sha256=LDxQoL2StjLGPefCN0y67nhIDN3xSE6Qn8G-tWC-oGA,3421
|
|
6
6
|
mapillary_tools/constants.py,sha256=fk5HBczTBGyDOKQy-grzlf0SafiGwggdF8Ota13Rk0k,6235
|
|
7
7
|
mapillary_tools/exceptions.py,sha256=uxTgBEfXgGxT0XNGRIAZ5mjtdqsCYfP6gnaXAK_ewBM,2483
|
|
8
8
|
mapillary_tools/exif_read.py,sha256=nAbZDYAIBx3g4n6QIGKXX3s-A3SkfuvZQBInDrXMlKk,32220
|
|
@@ -15,14 +15,14 @@ mapillary_tools/geo.py,sha256=mWaESfDf_zHmyvnt5aVFro4FGrjiULNsuZ6HfGUWvSA,11009
|
|
|
15
15
|
mapillary_tools/history.py,sha256=LP6e0zEYVBwRGUbFaGoE_AaBIEdpB4XrZsg9qwJVvRI,5344
|
|
16
16
|
mapillary_tools/http.py,sha256=-df_oGyImO2AOmPnXcKMcztlL4LOZLArE6ki81NMGUA,6411
|
|
17
17
|
mapillary_tools/ipc.py,sha256=DwWQb9hNshx0bg0Fo5NjY0mXjs-FkbR6tIQmjMgMtmg,1089
|
|
18
|
-
mapillary_tools/process_geotag_properties.py,sha256=
|
|
18
|
+
mapillary_tools/process_geotag_properties.py,sha256=3EaVvjfKB-O38OjopBcxeEdP6qI5IPIxqmO6isjcXKM,14205
|
|
19
19
|
mapillary_tools/process_sequence_properties.py,sha256=n4VjQHrgVjksIr3WoBviRhrQIBBDHGXMClolfyz6tu4,24057
|
|
20
20
|
mapillary_tools/sample_video.py,sha256=pKSj1Vc8e5p1XGjykBuKY9XieTOskc-9L3F4L407jDM,13935
|
|
21
21
|
mapillary_tools/telemetry.py,sha256=lL6qQbtOZft4DZZrCNK3njlwHT_30zLyYS_YRN5pgHY,1568
|
|
22
22
|
mapillary_tools/types.py,sha256=pIU2wcxiOUWT5Pd05pgNzY9EVEDlwoldtlF2IIYYvE0,5909
|
|
23
|
-
mapillary_tools/upload.py,sha256=
|
|
23
|
+
mapillary_tools/upload.py,sha256=XejAgmVW4Y33MiQ2g-shvHZA_zXTekEsOUHUHNx2AE4,24047
|
|
24
24
|
mapillary_tools/upload_api_v4.py,sha256=VgOf7RhfUuzmlSBUp5CpekKIJ0xQrC0r-r0Ds9-wU4I,7344
|
|
25
|
-
mapillary_tools/uploader.py,sha256=
|
|
25
|
+
mapillary_tools/uploader.py,sha256=Rw-1AkxE4TnddJNU6EW--9wmKYRqHbcTeheujdaluiM,39813
|
|
26
26
|
mapillary_tools/utils.py,sha256=cP9idKt4EJqfC0qqOGneSoPNpPiYhaW8VjQ9CLYjESc,8092
|
|
27
27
|
mapillary_tools/camm/camm_builder.py,sha256=ub6Z9ijep8zAo1NOlU51Gxk95kQ2vfN58YgVCLmNMRk,9211
|
|
28
28
|
mapillary_tools/camm/camm_parser.py,sha256=aNHP65hNXYQBWBTfhaj_S5XYzmAHhjwcAfGhbm83__o,18043
|
|
@@ -48,7 +48,7 @@ mapillary_tools/geotag/geotag_images_from_video.py,sha256=3NV3-NfSkxT0n_n8Ajqjab
|
|
|
48
48
|
mapillary_tools/geotag/geotag_videos_from_exiftool.py,sha256=Splhtv21JvrbFPVuKycf5wen0wOJ0zqOWk8d4aSw-ys,5345
|
|
49
49
|
mapillary_tools/geotag/geotag_videos_from_gpx.py,sha256=IoV7asxl7dojF1lftvohm1jK_LboFg_mBz25GiV_CsY,1653
|
|
50
50
|
mapillary_tools/geotag/geotag_videos_from_video.py,sha256=T8XS4lVF2Wz4eDXNi5Vt076M5dxjxJXibVrWhqVvErs,863
|
|
51
|
-
mapillary_tools/geotag/options.py,sha256=
|
|
51
|
+
mapillary_tools/geotag/options.py,sha256=AgINCSBlxT9Etfu05zuzunWgcCHVWdFjWVL7oBduL4g,5166
|
|
52
52
|
mapillary_tools/geotag/utils.py,sha256=tixXiN3uda2HuMnuXVu4xapgoSzZ86kNlJJQ66QERk0,1588
|
|
53
53
|
mapillary_tools/geotag/image_extractors/base.py,sha256=XoNrLCbJtd-MN-snbhv6zyr6zBfJRoJkntV0ptrh6qg,358
|
|
54
54
|
mapillary_tools/geotag/image_extractors/exif.py,sha256=cCUegbFqWxjAP4oOP1nZmwoJISWeKgjGO8h_t7nucHs,2079
|
|
@@ -66,11 +66,11 @@ mapillary_tools/mp4/io_utils.py,sha256=KZaJTlgFS27Oh3pcA5MKXYFoCifqgFaEZJyU6lb1j
|
|
|
66
66
|
mapillary_tools/mp4/mp4_sample_parser.py,sha256=0ILTq8M6mXFTI3agKgljpvO9uYa7HXGUGZpdHT8a6ac,11547
|
|
67
67
|
mapillary_tools/mp4/simple_mp4_builder.py,sha256=9TUGk1hzI6mQFN1P30jwHL3dCYz3Zz7rsm8UBvMAqMc,12734
|
|
68
68
|
mapillary_tools/mp4/simple_mp4_parser.py,sha256=g3vvPhBoNu7anhVzC5_XQCV7IwfRWro1vJ6d6GyDkHE,6315
|
|
69
|
-
mapillary_tools/serializer/description.py,sha256=
|
|
69
|
+
mapillary_tools/serializer/description.py,sha256=ECnQxC-1LOgkAKE5qFi9Y2KuCeH8KPUjjNFDiwebjvo,18647
|
|
70
70
|
mapillary_tools/serializer/gpx.py,sha256=_xx6gHjaWHrlXaUpB5GGBrbRKzbExFyIzWWAH-CvksI,4383
|
|
71
|
-
mapillary_tools-0.14.
|
|
72
|
-
mapillary_tools-0.14.
|
|
73
|
-
mapillary_tools-0.14.
|
|
74
|
-
mapillary_tools-0.14.
|
|
75
|
-
mapillary_tools-0.14.
|
|
76
|
-
mapillary_tools-0.14.
|
|
71
|
+
mapillary_tools-0.14.2.dist-info/licenses/LICENSE,sha256=l2D8cKfFmmJq_wcVq_JElPJrlvWQOzNWx7gMLINucxc,1292
|
|
72
|
+
mapillary_tools-0.14.2.dist-info/METADATA,sha256=rEmF5Twbh9m-zYNF1klQjGLOIrmiv5mCAQnbOb1Z8GE,22200
|
|
73
|
+
mapillary_tools-0.14.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
74
|
+
mapillary_tools-0.14.2.dist-info/entry_points.txt,sha256=A3f3LP-BO_P-U8Y29QfpT4jx6Mjk3sXjTi2Yew4bvj8,75
|
|
75
|
+
mapillary_tools-0.14.2.dist-info/top_level.txt,sha256=FbDkMgOrt1S70ho1WSBrOwzKOSkJFDwwqFOoY5-527s,16
|
|
76
|
+
mapillary_tools-0.14.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|