mapillary-downloader 0.7.6__tar.gz → 0.7.7__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 (19) hide show
  1. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/PKG-INFO +1 -1
  2. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/pyproject.toml +1 -1
  3. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/utils.py +4 -2
  4. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/worker.py +1 -1
  5. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/LICENSE.md +0 -0
  6. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/README.md +0 -0
  7. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/__init__.py +0 -0
  8. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/__main__.py +0 -0
  9. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/client.py +0 -0
  10. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/downloader.py +0 -0
  11. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/exif_writer.py +0 -0
  12. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/ia_check.py +0 -0
  13. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/ia_meta.py +0 -0
  14. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/ia_stats.py +0 -0
  15. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/logging_config.py +0 -0
  16. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/metadata_reader.py +0 -0
  17. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/tar_sequences.py +0 -0
  18. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/webp_converter.py +0 -0
  19. {mapillary_downloader-0.7.6 → mapillary_downloader-0.7.7}/src/mapillary_downloader/worker_pool.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mapillary_downloader
3
- Version: 0.7.6
3
+ Version: 0.7.7
4
4
  Summary: Archive user data from Mapillary
5
5
  Author-email: Gareth Davidson <gaz@bitplane.net>
6
6
  Requires-Python: >=3.10
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "mapillary_downloader"
3
3
  description = "Archive user data from Mapillary"
4
- version = "0.7.6"
4
+ version = "0.7.7"
5
5
  authors = [
6
6
  { name = "Gareth Davidson", email = "gaz@bitplane.net" }
7
7
  ]
@@ -77,7 +77,7 @@ def safe_json_save(file_path, data):
77
77
  temp_file.replace(file_path)
78
78
 
79
79
 
80
- def http_get_with_retry(url, params=None, max_retries=5, base_delay=1.0, timeout=60):
80
+ def http_get_with_retry(url, params=None, max_retries=5, base_delay=1.0, timeout=60, session=None):
81
81
  """HTTP GET with exponential backoff retry.
82
82
 
83
83
  Args:
@@ -86,6 +86,7 @@ def http_get_with_retry(url, params=None, max_retries=5, base_delay=1.0, timeout
86
86
  max_retries: Maximum retry attempts (default: 5)
87
87
  base_delay: Initial delay in seconds (default: 1.0)
88
88
  timeout: Request timeout in seconds (default: 60)
89
+ session: Optional requests.Session for connection pooling
89
90
 
90
91
  Returns:
91
92
  requests.Response object
@@ -93,9 +94,10 @@ def http_get_with_retry(url, params=None, max_retries=5, base_delay=1.0, timeout
93
94
  Raises:
94
95
  requests.RequestException: If all retries exhausted
95
96
  """
97
+ getter = session or requests
96
98
  for attempt in range(max_retries):
97
99
  try:
98
- response = requests.get(url, params=params, timeout=timeout)
100
+ response = getter.get(url, params=params, timeout=timeout)
99
101
  response.raise_for_status()
100
102
  return response
101
103
  except RequestException as e:
@@ -105,7 +105,7 @@ def download_and_convert_image(image_data, output_dir, quality, convert_webp, se
105
105
 
106
106
  try:
107
107
  # Use retry logic with 3 attempts for image downloads
108
- response = http_get_with_retry(image_url, max_retries=3, base_delay=1.0, timeout=60)
108
+ response = http_get_with_retry(image_url, max_retries=3, base_delay=1.0, timeout=60, session=session)
109
109
 
110
110
  with open(jpg_path, "wb") as f:
111
111
  for chunk in response.iter_content(chunk_size=8192):