mapillary-tools 0.14.1__tar.gz → 0.14.2__tar.gz

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.
Files changed (82) hide show
  1. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/PKG-INFO +1 -1
  2. mapillary_tools-0.14.2/mapillary_tools/__init__.py +1 -0
  3. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/authenticate.py +1 -1
  4. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/config.py +5 -0
  5. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/options.py +4 -1
  6. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/process_geotag_properties.py +4 -11
  7. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/serializer/description.py +12 -2
  8. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/upload.py +1 -2
  9. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/uploader.py +8 -0
  10. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools.egg-info/PKG-INFO +1 -1
  11. mapillary_tools-0.14.1/mapillary_tools/__init__.py +0 -1
  12. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/LICENSE +0 -0
  13. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/README.md +0 -0
  14. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/api_v4.py +0 -0
  15. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/blackvue_parser.py +0 -0
  16. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/camm/camm_builder.py +0 -0
  17. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/camm/camm_parser.py +0 -0
  18. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/commands/__init__.py +0 -0
  19. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/commands/__main__.py +0 -0
  20. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/commands/authenticate.py +0 -0
  21. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/commands/process.py +0 -0
  22. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/commands/process_and_upload.py +0 -0
  23. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/commands/sample_video.py +0 -0
  24. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/commands/upload.py +0 -0
  25. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/commands/video_process.py +0 -0
  26. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/commands/video_process_and_upload.py +0 -0
  27. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/commands/zip.py +0 -0
  28. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/constants.py +0 -0
  29. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/exceptions.py +0 -0
  30. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/exif_read.py +0 -0
  31. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/exif_write.py +0 -0
  32. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/exiftool_read.py +0 -0
  33. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/exiftool_read_video.py +0 -0
  34. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/exiftool_runner.py +0 -0
  35. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/ffmpeg.py +0 -0
  36. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geo.py +0 -0
  37. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/__init__.py +0 -0
  38. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/base.py +0 -0
  39. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/factory.py +0 -0
  40. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/geotag_images_from_exif.py +0 -0
  41. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/geotag_images_from_exiftool.py +0 -0
  42. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/geotag_images_from_gpx.py +0 -0
  43. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/geotag_images_from_gpx_file.py +0 -0
  44. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/geotag_images_from_nmea_file.py +0 -0
  45. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/geotag_images_from_video.py +0 -0
  46. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/geotag_videos_from_exiftool.py +0 -0
  47. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/geotag_videos_from_gpx.py +0 -0
  48. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/geotag_videos_from_video.py +0 -0
  49. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/image_extractors/base.py +0 -0
  50. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/image_extractors/exif.py +0 -0
  51. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/image_extractors/exiftool.py +0 -0
  52. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/utils.py +0 -0
  53. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/video_extractors/base.py +0 -0
  54. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/video_extractors/exiftool.py +0 -0
  55. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/video_extractors/gpx.py +0 -0
  56. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/geotag/video_extractors/native.py +0 -0
  57. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/gpmf/gpmf_gps_filter.py +0 -0
  58. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/gpmf/gpmf_parser.py +0 -0
  59. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/gpmf/gps_filter.py +0 -0
  60. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/history.py +0 -0
  61. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/http.py +0 -0
  62. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/ipc.py +0 -0
  63. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/mp4/__init__.py +0 -0
  64. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/mp4/construct_mp4_parser.py +0 -0
  65. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/mp4/io_utils.py +0 -0
  66. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/mp4/mp4_sample_parser.py +0 -0
  67. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/mp4/simple_mp4_builder.py +0 -0
  68. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/mp4/simple_mp4_parser.py +0 -0
  69. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/process_sequence_properties.py +0 -0
  70. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/sample_video.py +0 -0
  71. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/serializer/gpx.py +0 -0
  72. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/telemetry.py +0 -0
  73. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/types.py +0 -0
  74. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/upload_api_v4.py +0 -0
  75. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools/utils.py +0 -0
  76. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools.egg-info/SOURCES.txt +0 -0
  77. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools.egg-info/dependency_links.txt +0 -0
  78. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools.egg-info/entry_points.txt +0 -0
  79. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools.egg-info/requires.txt +0 -0
  80. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/mapillary_tools.egg-info/top_level.txt +0 -0
  81. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/pyproject.toml +0 -0
  82. {mapillary_tools-0.14.1 → mapillary_tools-0.14.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mapillary_tools
3
- Version: 0.14.1
3
+ Version: 0.14.2
4
4
  Summary: Mapillary Image/Video Import Pipeline
5
5
  Author-email: Mapillary <support@mapillary.com>
6
6
  License: BSD
@@ -0,0 +1 @@
1
+ VERSION = "0.14.2"
@@ -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
- jsonschema.validate(user_items, config.UserItemSchema)
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}"
@@ -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
- jsonschema.validate(instance=instance, schema=SourceOptionSchema)
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
- tqdm(
315
- map_results,
316
- desc="Validating metadatas",
317
- unit="metadata",
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
- jsonschema.validate(instance=desc, schema=ImageDescriptionFileSchema)
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
- jsonschema.validate(instance=desc, schema=VideoDescriptionFileSchema)
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
@@ -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
- jsonschema.validate(instance=user_items, schema=config.UserItemSchema)
59
+ config.UserItemSchemaValidator.validate(user_items)
61
60
 
62
61
  # Setup the emitter -- the order matters here
63
62
 
@@ -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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mapillary_tools
3
- Version: 0.14.1
3
+ Version: 0.14.2
4
4
  Summary: Mapillary Image/Video Import Pipeline
5
5
  Author-email: Mapillary <support@mapillary.com>
6
6
  License: BSD
@@ -1 +0,0 @@
1
- VERSION = "0.14.1"